open-nomad/ui/tests/pages/components/two-step-button.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
887 B
JavaScript
Raw Normal View History

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
2021-12-28 16:08:12 +00:00
import {
attribute,
clickable,
hasClass,
isPresent,
text,
} from 'ember-cli-page-object';
2021-12-28 14:45:20 +00:00
export default (scope) => ({
scope,
isPresent: isPresent(),
idle: clickable('[data-test-idle-button]'),
confirm: clickable('[data-test-confirm-button]'),
cancel: clickable('[data-test-cancel-button]'),
isRunning: hasClass('is-loading', '[data-test-confirm-button]'),
isDisabled: attribute('disabled', '[data-test-idle-button]'),
cancelIsDisabled: attribute('disabled', '[data-test-cancel-button]'),
confirmIsDisabled: attribute('disabled', '[data-test-confirm-button]'),
idleText: text('[data-test-idle-button]'),
cancelText: text('[data-test-cancel-button]'),
confirmText: text('[data-test-confirm-button]'),
confirmationMessage: text('[data-test-confirmation-message]'),
});