open-nomad/ui/tests/pages/optimize.js
Michael Lange e8593ec1bb
ui: Update namespaces design (#10444)
This rethinks namespaces as a filter on list pages rather than a global setting.

The biggest net-new feature here is being able to select All (*) to list all jobs
or CSI volumes across namespaces.
2021-04-29 15:00:59 -05:00

64 lines
1.7 KiB
JavaScript

import {
attribute,
clickable,
collection,
create,
hasClass,
isPresent,
text,
visitable,
} from 'ember-cli-page-object';
import recommendationCard from 'nomad-ui/tests/pages/components/recommendation-card';
import { multiFacet, singleFacet } from 'nomad-ui/tests/pages/components/facet';
export default create({
visit: visitable('/optimize'),
search: {
scope: '[data-test-recommendation-summaries-search] input',
placeholder: attribute('placeholder'),
},
facets: {
namespace: singleFacet('[data-test-namespace-facet]'),
type: multiFacet('[data-test-type-facet]'),
status: multiFacet('[data-test-status-facet]'),
datacenter: multiFacet('[data-test-datacenter-facet]'),
prefix: multiFacet('[data-test-prefix-facet]'),
},
card: recommendationCard,
recommendationSummaries: collection('[data-test-recommendation-summary-row]', {
isActive: hasClass('is-active'),
isDisabled: hasClass('is-disabled'),
slug: text('[data-test-slug]'),
namespace: text('[data-test-namespace]'),
date: text('[data-test-date]'),
allocationCount: text('[data-test-allocation-count]'),
cpu: text('[data-test-cpu]'),
memory: text('[data-test-memory]'),
aggregateCpu: text('[data-test-aggregate-cpu]'),
aggregateMemory: text('[data-test-aggregate-memory]'),
}),
empty: {
scope: '[data-test-empty-recommendations]',
headline: text('[data-test-empty-recommendations-headline]'),
},
error: {
scope: '[data-test-recommendation-error]',
headline: text('[data-test-headline]'),
errors: text('[data-test-errors]'),
dismiss: clickable('[data-test-dismiss]'),
},
applicationError: {
isPresent: isPresent('[data-test-error]'),
title: text('[data-test-error-title]'),
},
});