From da941d2e447bb74b1f90184e14548c80c16cb878 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Thu, 21 Nov 2019 16:51:23 -0800 Subject: [PATCH] Model the notification pattern as a page object component --- ui/app/templates/clients/client.hbs | 54 +++++++++++------------ ui/tests/pages/components/notification.js | 10 +++++ 2 files changed, 37 insertions(+), 27 deletions(-) create mode 100644 ui/tests/pages/components/notification.js diff --git a/ui/app/templates/clients/client.hbs b/ui/app/templates/clients/client.hbs index cc55f96a0..0d2017916 100644 --- a/ui/app/templates/clients/client.hbs +++ b/ui/app/templates/clients/client.hbs @@ -1,79 +1,79 @@ {{title "Client " (or model.name model.shortId)}}
{{#if eligibilityError}} -
+
-
-

Eligibility Error

-

{{eligibilityError}}

+
+

Eligibility Error

+

{{eligibilityError}}

- +
{{/if}} {{#if stopDrainError}} -
+
-
-

Stop Drain Error

-

{{stopDrainError}}

+
+

Stop Drain Error

+

{{stopDrainError}}

- +
{{/if}} {{#if drainError}} -
+
-
-

Drain Error

-

{{drainError}}

+
+

Drain Error

+

{{drainError}}

- +
{{/if}} {{#if showDrainStoppedNotification}}
-
+
-

Drain Stopped

-

The drain has been stopped and the node has been set to ineligible.

+

Drain Stopped

+

The drain has been stopped and the node has been set to ineligible.

- +
{{/if}} {{#if showDrainUpdateNotification}}
-
+
-

Drain Updated

-

The new drain specification has been applied.

+

Drain Updated

+

The new drain specification has been applied.

- +
{{/if}} {{#if showDrainNotification}}
-
+
-

Drain Complete

-

Allocations have been drained and the node has been set to ineligible.

+

Drain Complete

+

Allocations have been drained and the node has been set to ineligible.

- +
diff --git a/ui/tests/pages/components/notification.js b/ui/tests/pages/components/notification.js new file mode 100644 index 000000000..95e4a20a8 --- /dev/null +++ b/ui/tests/pages/components/notification.js @@ -0,0 +1,10 @@ +import { isPresent, clickable, text } from 'ember-cli-page-object'; + +export default scope => ({ + scope, + + isPresent: isPresent(), + dismiss: clickable('[data-test-dismiss]'), + title: text('[data-test-title]'), + message: text('[data-test-message]'), +});