Skip to content

Commit 0f55f60

Browse files
committed
test: prove the declined confirmation deleted nothing
The case asserted the abort message and stopped there, so it would have passed had the delete gone out anyway. Answering the prompt with y now fails it, which is what "nothing deleted" is supposed to mean. beep boop
1 parent 969142e commit 0f55f60

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

internal/cmd/testdata/script/confirm.txtar

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44

55
# Given: FLAGSMITH_NO_INPUT set to a falsey value, and a terminal to prompt on
66
# When: a destructive command runs and the confirmation is declined
7-
# Then: the prompt still ran — a falsey value switches the behaviour off rather than merely being set
7+
# Then: the prompt still ran, and declining it deleted nothing — a falsey value switches the behaviour off rather than merely being set
88
env FLAGSMITH_NO_INPUT=false
99
ttyin -stdin decline
1010
exec flagsmith project delete 101
1111
stderr 'Aborted; nothing deleted\.'
12+
dump requests requests.txt
13+
! grep 'DELETE /api/v1/projects/101/' requests.txt
1214
env FLAGSMITH_NO_INPUT=
1315

1416
-- flagsmith.json --

0 commit comments

Comments
 (0)