Skip to content

Commit 231458d

Browse files
test: [M3-10325] - Show legacy 'Save Alerts' confirmation modal only if user has already opted into Beta Alerts mode (linode#12683)
* prompt in beta region in legacy mode * Added changeset: Show legacy 'Save Alerts' confirmation modal only if user has already opted into Beta Alerts mode
1 parent 235d4ae commit 231458d

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Tests
3+
---
4+
5+
Show legacy 'Save Alerts' confirmation modal only if user has already opted into Beta Alerts mode ([#12683](https://github.com/linode/manager/pull/12683))

packages/manager/cypress/e2e/core/linodes/alerts-edit.spec.ts

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
ALERTS_BETA_MODE_BUTTON_TEXT,
1717
ALERTS_LEGACY_MODE_BANNER_TEXT,
1818
ALERTS_LEGACY_MODE_BUTTON_TEXT,
19+
ALERTS_LEGACY_PROMPT,
1920
} from 'src/features/Linodes/constants';
2021

2122
const MOCK_LINODE_ID = 2;
@@ -387,23 +388,12 @@ describe('region enables alerts', function () {
387388
.should('be.enabled')
388389
.click();
389390
});
390-
// TODO: this test passes but modal behavior may change when properly implemented in api (M3-10195)
391-
// ui.dialog
392-
// .findByTitle('Are you sure you want to save legacy Alerts?')
393-
// .should('be.visible')
394-
// .within(() => {
395-
// ui.button.findByTitle('Confirm').should('be.visible')
396-
// .click();
397-
// });
398-
// TODO: this test passes but modal behavior will change when properly implemented in api (M3-10195)
399-
// TODO: this test passes but modal behavior may change when properly implemented in api (M3-10195)
400-
// ui.dialog
401-
// .findByTitle('Save Alerts?')
402-
// .should('be.visible')
403-
// .within(() => {
404-
// ui.button.findByTitle('Save').should('be.visible')
405-
// .click();
406-
// });
391+
ui.dialog
392+
.findByTitle(ALERTS_LEGACY_PROMPT)
393+
.should('be.visible')
394+
.within(() => {
395+
ui.button.findByTitle('Confirm').should('be.visible').click();
396+
});
407397
});
408398
});
409399

packages/manager/src/features/Linodes/constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ export const ALERTS_BETA_MODE_BANNER_TEXT =
2626
export const ALERTS_LEGACY_MODE_BUTTON_TEXT = 'Try Alerts (Beta)';
2727

2828
export const ALERTS_BETA_MODE_BUTTON_TEXT = 'Switch to legacy Alerts';
29+
30+
export const ALERTS_LEGACY_PROMPT =
31+
'Are you sure you want to save legacy Alerts?';

0 commit comments

Comments
 (0)