Skip to content

Commit

Permalink
Test cases updated for new notifs
Browse files Browse the repository at this point in the history
  • Loading branch information
philrenaud committed Feb 10, 2023
1 parent 0c284a5 commit f78f14d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .changelog/16099.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
ui: Restyles "toast" notifications in the web UI with the Helios Design System
```
2 changes: 1 addition & 1 deletion ui/app/components/variable-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export default class VariableFormComponent extends Component {
} catch (error) {
notifyConflict(this)(error);
if (!this.hasConflict) {
this.flashMnotificationsessages.add({
this.notifications.add({
title: `Error saving ${this.path}`,
message: error,
color: 'critical',
Expand Down
4 changes: 2 additions & 2 deletions ui/tests/acceptance/allocation-detail-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,11 +464,11 @@ module('Acceptance | allocation detail', function (hooks) {

component.onClick();

await waitFor('.flash-message.alert-error');
await waitFor('.flash-message.alert-critical');

assert.verifySteps(['Transition dispatched.']);
assert
.dom('.flash-message.alert-error')
.dom('.flash-message.alert-critical')
.exists('A toast error message pops up.');

// Clean-up
Expand Down
2 changes: 1 addition & 1 deletion ui/tests/acceptance/job-run-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ module('Acceptance | job run', function (hooks) {
'We do not navigate away from the page if an error is returned by the API.'
);
assert
.dom('.flash-message.alert-error')
.dom('.flash-message.alert-critical')
.exists('A toast error message pops up.');
});

Expand Down
2 changes: 1 addition & 1 deletion ui/tests/acceptance/policies-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module('Acceptance | policies', function (hooks) {
await typeIn('[data-test-policy-name-input]', 'My Fun Policy');
await click('button[type="submit"]');
assert
.dom('.flash-message.alert-error')
.dom('.flash-message.alert-critical')
.exists('Doesnt let you save a bad name');
assert.equal(currentURL(), '/policies/new');
document.querySelector('[data-test-policy-name-input]').value = ''; // clear
Expand Down
8 changes: 4 additions & 4 deletions ui/tests/acceptance/token-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ module('Acceptance | tokens', function (hooks) {
// TTL Action
await Jobs.visit();
assert
.dom('.flash-message.alert-error button')
.dom('.flash-message.alert-warning button')
.exists('A global alert exists and has a clickable button');

await click('.flash-message.alert-error button');
await click('.flash-message.alert-warning button');
assert.equal(
currentURL(),
'/settings/tokens',
Expand Down Expand Up @@ -313,7 +313,7 @@ module('Acceptance | tokens', function (hooks) {
// short-circuiting our Ember Concurrency loop.
setTimeout(() => {
assert
.dom('.flash-message.alert-error')
.dom('.flash-message.alert-warning')
.doesNotExist('No notification yet for a token with 10m5s left');
notificationNotRendered();
setTimeout(async () => {
Expand All @@ -322,7 +322,7 @@ module('Acceptance | tokens', function (hooks) {
});

assert
.dom('.flash-message.alert-error')
.dom('.flash-message.alert-warning')
.exists('Notification is rendered at the 10m mark');
notificationRendered();
run.cancelTimers();
Expand Down
6 changes: 3 additions & 3 deletions ui/tests/acceptance/variables-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,9 @@ module('Acceptance | variables', function (hooks) {
assert.equal(currentURL(), '/variables/new');
await typeIn('.path-input', 'foo/bar');
await click('button[type="submit"]');
assert.dom('.flash-message.alert-error').exists();
await click('.flash-message.alert-error .close-button');
assert.dom('.flash-message.alert-error').doesNotExist();
assert.dom('.flash-message.alert-critical').exists();
await click('.flash-message.alert-critical .hds-dismiss-button');
assert.dom('.flash-message.alert-critical').doesNotExist();

await typeIn('.key-value label:nth-child(1) input', 'myKey');
await typeIn('.key-value label:nth-child(2) input', 'superSecret');
Expand Down

0 comments on commit f78f14d

Please sign in to comment.