Files
nomad/ui/tests/pages/components/toggle.js
2023-04-10 15:36:59 +00:00

30 lines
610 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import {
attribute,
property,
clickable,
hasClass,
isPresent,
text,
} from 'ember-cli-page-object';
export default (scope) => ({
scope,
isPresent: isPresent(),
isDisabled: attribute('disabled', '[data-test-input]'),
isActive: property('checked', '[data-test-input]'),
hasDisabledClass: hasClass('is-disabled', '[data-test-label]'),
hasActiveClass: hasClass('is-active', '[data-test-label]'),
label: text('[data-test-label]'),
title: attribute('title'),
toggle: clickable('[data-test-input]'),
});