Consistently use PageObjects now that they all exist

This commit is contained in:
Michael Lange 2018-07-11 12:42:43 -07:00
parent f74694b0a0
commit 8154d68b95
3 changed files with 12 additions and 11 deletions

View file

@ -1,4 +1,4 @@
import { currentURL, visit } from 'ember-native-dom-helpers';
import { currentURL } from 'ember-native-dom-helpers';
import { test } from 'qunit';
import moduleForAcceptance from 'nomad-ui/tests/helpers/module-for-acceptance';
import moduleForJob from 'nomad-ui/tests/helpers/module-for-job';
@ -35,7 +35,6 @@ moduleForJob('Acceptance | job detail (service)', () => server.create('job', { t
let job;
test('when the job is not found, an error message is shown, but the URL persists', function(assert) {
visit('/jobs/not-a-real-job');
JobDetail.visit({ id: 'not-a-real-job' });
andThen(() => {

View file

@ -1,4 +1,4 @@
import { currentURL, visit } from 'ember-native-dom-helpers';
import { currentURL } from 'ember-native-dom-helpers';
import { test } from 'qunit';
import moduleForAcceptance from 'nomad-ui/tests/helpers/module-for-acceptance';
import Task from 'nomad-ui/tests/pages/allocations/task/detail';
@ -189,7 +189,6 @@ moduleForAcceptance('Acceptance | task detail (no addresses)', {
allocation = server.create('allocation', 'withoutTaskWithPorts');
task = server.db.taskStates.where({ allocationId: allocation.id })[0];
visit(`/allocations/${allocation.id}/${task.name}`);
Task.visit({ id: allocation.id, name: task.name });
},
});

View file

@ -1,7 +1,10 @@
import { find, visit } from 'ember-native-dom-helpers';
import { find } from 'ember-native-dom-helpers';
import { test, skip } from 'ember-qunit';
import moduleForAcceptance from 'nomad-ui/tests/helpers/module-for-acceptance';
import Tokens from 'nomad-ui/tests/pages/settings/tokens';
import Jobs from 'nomad-ui/tests/pages/jobs/list';
import JobDetail from 'nomad-ui/tests/pages/jobs/detail';
import ClientDetail from 'nomad-ui/tests/pages/clients/detail';
let job;
let node;
@ -39,8 +42,8 @@ skip('the X-Nomad-Token header gets sent with requests once it is set', function
const { secretId } = managementToken;
let requestPosition = 0;
visit(`/jobs/${job.id}`);
visit(`/clients/${node.id}`);
JobDetail.visit({ id: job.id });
ClientDetail.visit({ id: node.id });
andThen(() => {
assert.ok(server.pretender.handledRequests.length > 1, 'Requests have been made');
@ -58,8 +61,8 @@ skip('the X-Nomad-Token header gets sent with requests once it is set', function
Tokens.secret(secretId).submit();
});
visit(`/jobs/${job.id}`);
visit(`/clients/${node.id}`);
JobDetail.visit({ id: job.id });
ClientDetail.visit({ id: node.id });
andThen(() => {
const newRequests = server.pretender.handledRequests.slice(requestPosition);
@ -147,7 +150,7 @@ test('a success message and associated policies are shown when authenticating su
test('setting a token clears the store', function(assert) {
const { secretId } = clientToken;
visit('/jobs');
Jobs.visit();
andThen(() => {
assert.ok(find('.job-row'), 'Jobs found');
@ -166,7 +169,7 @@ test('setting a token clears the store', function(assert) {
});
});
visit('/jobs');
Jobs.visit();
// If jobs are lingering in the store, they would show up
assert.notOk(find('[data-test-job-row]'), 'No jobs found');