From f6bbda06bebef9a9ce3693c19639b61a3563d181 Mon Sep 17 00:00:00 2001 From: Phil Renaud Date: Thu, 9 Feb 2023 15:38:21 -0500 Subject: [PATCH] Test cases updated for new notifs --- ui/app/components/variable-form.js | 2 +- ui/tests/acceptance/allocation-detail-test.js | 4 ++-- ui/tests/acceptance/job-run-test.js | 2 +- ui/tests/acceptance/policies-test.js | 2 +- ui/tests/acceptance/token-test.js | 8 ++++---- ui/tests/acceptance/variables-test.js | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ui/app/components/variable-form.js b/ui/app/components/variable-form.js index cd6deef5722..ac64fef2983 100644 --- a/ui/app/components/variable-form.js +++ b/ui/app/components/variable-form.js @@ -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', diff --git a/ui/tests/acceptance/allocation-detail-test.js b/ui/tests/acceptance/allocation-detail-test.js index 3503e45d0c0..cf31ddccbcd 100644 --- a/ui/tests/acceptance/allocation-detail-test.js +++ b/ui/tests/acceptance/allocation-detail-test.js @@ -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 diff --git a/ui/tests/acceptance/job-run-test.js b/ui/tests/acceptance/job-run-test.js index 39be3d21d6b..c0e28a949db 100644 --- a/ui/tests/acceptance/job-run-test.js +++ b/ui/tests/acceptance/job-run-test.js @@ -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.'); }); diff --git a/ui/tests/acceptance/policies-test.js b/ui/tests/acceptance/policies-test.js index db03c33e1bc..0931f24668c 100644 --- a/ui/tests/acceptance/policies-test.js +++ b/ui/tests/acceptance/policies-test.js @@ -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 diff --git a/ui/tests/acceptance/token-test.js b/ui/tests/acceptance/token-test.js index 6c6d4ff3aa4..63ab965f900 100644 --- a/ui/tests/acceptance/token-test.js +++ b/ui/tests/acceptance/token-test.js @@ -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', @@ -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 () => { @@ -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(); diff --git a/ui/tests/acceptance/variables-test.js b/ui/tests/acceptance/variables-test.js index 8e4d1aefc37..d0250eeff6c 100644 --- a/ui/tests/acceptance/variables-test.js +++ b/ui/tests/acceptance/variables-test.js @@ -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');