758e85bc84
Clicking in a task group row in the job details page would throw the error: Uncaught Error: You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route jobs.job.task-group. Missing params: name createParamHandlerInfo http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4814 applyToHandlers http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4804 applyToState http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4801 getTransitionByIntent http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4843 transitionByIntent http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4836 refresh http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4885 refresh http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:2254 queryParamsDidChange http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:2326 k http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:2423 triggerEvent http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:2349 fireQueryParamDidChange http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4863 getTransitionByIntent http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4848 transitionByIntent http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4836 doTransition http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4853 transitionTo http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:4882 _doTransition http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:2392 transitionTo http://localhost:4646/ui/assets/vendor-194b1e0d68d11ef7a4bf334eb30ba74d.js:2177 gotoTaskGroup http://localhost:4646/ui/assets/nomad-ui-4a2c1941e03e60e1feef715f23cf268c.js:623 ... This was caused because the attribute being passed to the transitionTo function was not the task group name, but the whole model.
132 lines
3.6 KiB
JavaScript
132 lines
3.6 KiB
JavaScript
import {
|
|
attribute,
|
|
create,
|
|
collection,
|
|
clickable,
|
|
hasClass,
|
|
isPresent,
|
|
property,
|
|
text,
|
|
visitable,
|
|
} from 'ember-cli-page-object';
|
|
|
|
import allocations from 'nomad-ui/tests/pages/components/allocations';
|
|
import taskGroups from 'nomad-ui/tests/pages/components/task-groups';
|
|
import twoStepButton from 'nomad-ui/tests/pages/components/two-step-button';
|
|
import recommendationAccordion from 'nomad-ui/tests/pages/components/recommendation-accordion';
|
|
import jobClientStatusBar from 'nomad-ui/tests/pages/components/job-client-status-bar';
|
|
|
|
export default create({
|
|
visit: visitable('/jobs/:id'),
|
|
|
|
jobName: text('[data-test-job-name]'),
|
|
|
|
tabs: collection('[data-test-tab]', {
|
|
id: attribute('data-test-tab'),
|
|
visit: clickable('a'),
|
|
}),
|
|
|
|
tabFor(id) {
|
|
return this.tabs.toArray().findBy('id', id);
|
|
},
|
|
|
|
recommendations: collection(
|
|
'[data-test-recommendation-accordion]',
|
|
recommendationAccordion
|
|
),
|
|
|
|
stop: twoStepButton('[data-test-stop]'),
|
|
start: twoStepButton('[data-test-start]'),
|
|
|
|
packTag: isPresent('[data-test-pack-tag]'),
|
|
metaTable: isPresent('[data-test-meta]'),
|
|
|
|
execButton: {
|
|
scope: '[data-test-exec-button]',
|
|
isDisabled: property('disabled'),
|
|
hasTooltip: hasClass('tooltip'),
|
|
tooltipText: attribute('aria-label'),
|
|
},
|
|
|
|
incrementButton: {
|
|
scope: '[data-test-scale-controls-increment]',
|
|
isDisabled: property('disabled'),
|
|
},
|
|
|
|
dispatchButton: {
|
|
scope: '[data-test-dispatch-button]',
|
|
isDisabled: property('disabled'),
|
|
},
|
|
|
|
stats: collection('[data-test-job-stat]', {
|
|
id: attribute('data-test-job-stat'),
|
|
text: text(),
|
|
}),
|
|
|
|
statFor(id) {
|
|
return this.stats.toArray().findBy('id', id);
|
|
},
|
|
|
|
packStats: collection('[data-test-pack-stat]', {
|
|
id: attribute('data-test-pack-stat'),
|
|
text: text(),
|
|
}),
|
|
|
|
packStatFor(id) {
|
|
return this.packStats.toArray().findBy('id', id);
|
|
},
|
|
|
|
jobClientStatusSummary: {
|
|
scope: '[data-test-job-client-summary]',
|
|
statusBar: jobClientStatusBar('[data-test-job-client-status-bar]'),
|
|
toggle: {
|
|
scope: '[data-test-accordion-head] [data-test-accordion-toggle]',
|
|
click: clickable(),
|
|
isDisabled: attribute('disabled'),
|
|
tooltip: attribute('aria-label'),
|
|
},
|
|
},
|
|
childrenSummary: jobClientStatusBar(
|
|
'[data-test-job-summary] [data-test-children-status-bar]'
|
|
),
|
|
allocationsSummary: jobClientStatusBar(
|
|
'[data-test-job-summary] [data-test-allocation-status-bar]'
|
|
),
|
|
...taskGroups(),
|
|
...allocations(),
|
|
|
|
viewAllAllocations: text('[data-test-view-all-allocations]'),
|
|
|
|
jobsHeader: {
|
|
scope: '[data-test-jobs-header]',
|
|
hasSubmitTime: isPresent('[data-test-jobs-submit-time-header]'),
|
|
hasNamespace: isPresent('[data-test-jobs-namespace-header]'),
|
|
},
|
|
|
|
jobs: collection('[data-test-job-row]', {
|
|
id: attribute('data-test-job-row'),
|
|
name: text('[data-test-job-name]'),
|
|
namespace: text('[data-test-job-namespace]'),
|
|
link: attribute('href', '[data-test-job-name] a'),
|
|
submitTime: text('[data-test-job-submit-time]'),
|
|
status: text('[data-test-job-status]'),
|
|
type: text('[data-test-job-type]'),
|
|
priority: text('[data-test-job-priority]'),
|
|
taskGroups: text('[data-test-job-task-groups]'),
|
|
|
|
clickRow: clickable(),
|
|
clickName: clickable('[data-test-job-name] a'),
|
|
}),
|
|
|
|
error: {
|
|
isPresent: isPresent('[data-test-error]'),
|
|
title: text('[data-test-error-title]'),
|
|
message: text('[data-test-error-message]'),
|
|
seekHelp: clickable('[data-test-error-message] a'),
|
|
},
|
|
|
|
recentAllocationsEmptyState: {
|
|
headline: text('[data-test-empty-recent-allocations-headline]'),
|
|
},
|
|
});
|