Skip to content

Commit ee44ded

Browse files
committed
adding a confirm when deleting a test
1 parent c4acee9 commit ee44ded

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

packages/selenium-ide/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@seleniumhq/selenium-ide",
3-
"version": "4.0.0-alpha.23",
3+
"version": "4.0.0-alpha.24",
44
"private": true,
55
"description": "Selenium IDE electron app",
66
"author": "Todd <[email protected]>",
@@ -100,7 +100,7 @@
100100
"@mui/lab": "^5.0.0-alpha.72",
101101
"@mui/material": "^5.5.0",
102102
"@seleniumhq/get-driver": "^4.0.0-alpha.1",
103-
"@seleniumhq/side-api": "^4.0.0-alpha.9",
103+
"@seleniumhq/side-api": "^4.0.0-alpha.10",
104104
"@seleniumhq/side-model": "^4.0.0-alpha.2",
105105
"@seleniumhq/side-plugin-example": "^4.0.0-alpha.1",
106106
"@seleniumhq/side-runtime": "^4.0.0-alpha.14",

packages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Tests/TestsDrawer.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ const TestList: FC<TestListProps> = ({ activeTest, open, setOpen, tests }) => {
4141
}}
4242
onRemove={
4343
tests.length > 1
44-
? () => window.sideAPI.tests.delete(activeTest)
44+
? () => {
45+
const doDelete = window.confirm('Delete this test?')
46+
if (doDelete) {
47+
window.sideAPI.tests.delete(activeTest)
48+
}
49+
}
4550
: undefined
4651
}
4752
sx={{

packages/side-api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@seleniumhq/side-api",
3-
"version": "4.0.0-alpha.9",
3+
"version": "4.0.0-alpha.10",
44
"description": "Selenium IDE shared models",
55
"author": "Todd Tarsi <[email protected]>",
66
"homepage": "http://github.com/SeleniumHQ/selenium-ide",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/**
2+
* Shows a confirm dialog and passes back the boolean of confirmation
3+
*/
4+
export type Shape = () => Promise<boolean>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1+
import type { Shape as Confirm } from './confirm'
12
import type { Shape as Open } from './open'
23

4+
import * as confirm from './confirm'
35
import * as open from './open'
46

57
export const commands = {
8+
confirm,
69
open,
710
}
811

912
/**
1013
* Manages the presenting of dialogs to the user
1114
*/
1215
export type Shape = {
16+
confirm: Confirm
1317
open: Open
1418
}

0 commit comments

Comments
 (0)