Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
ui: fixed tests and made more comprehensive
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabrina Ko committed Jan 12, 2022
1 parent 49be4c2 commit 64d0ccb
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions ui/tests/acceptance/deployments-list-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const page = create({
visit: visitable(url),
showDestroyed: clickable('[data-test-display-destroyed-button]'),
linkList: collection('[data-test-deployment-list-item]'),
statusIndicators: collection('[data-test-health-status="alive"]'),
deployUrls: collection('.deploy-url'),
aliveStatusIndicators: collection('[data-test-health-status="alive"]'),
healthCheckOrDeployUrls: collection('.health-check--text-description'),
operationStatuses: collection('[data-test-operation-status]'),
gitCommits: collection('[data-test-git-commit]'),
});
Expand All @@ -28,19 +28,19 @@ module('Acceptance | deployments list', function (hooks) {
test('happy path', async function (assert) {
let project = this.server.create('project', { name: 'microchip' });
let application = this.server.create('application', { name: 'wp-bandwidth', project });
let deployments = this.server.createList('deployment', 4, 'random', { application });
let deployments = this.server.createList('deployment', 3, 'random', { application });
this.server.create('status-report', 'alive', { application, target: deployments[0] });
this.server.create('status-report', 'alive', { application, target: deployments[1] });
this.server.create('status-report', 'ready', { application, target: deployments[1] });

await page.visit();

assert.equal(page.linkList.length, 4);
assert.equal(currentURL(), redirectUrl + '4');
assert.equal(page.statusIndicators.length, 2);
assert.equal(page.operationStatuses.length, 4);
assert.equal(page.gitCommits.length, 4);
// random list item url check
assert.equal(page.deployUrls[page.deployUrls.length - 1].text, `wildly-intent-honeybee--v1.waypoint.run`);
assert.equal(page.linkList.length, 3);
assert.equal(currentURL(), redirectUrl + '3');
assert.equal(page.aliveStatusIndicators.length, 1);
assert.equal(page.operationStatuses.length, 3);
assert.equal(page.gitCommits.length, 3);
assert.equal(page.healthCheckOrDeployUrls[1].text, 'Starting…');
assert.equal(page.healthCheckOrDeployUrls[0].text, 'wildly-intent-honeybee--v2.waypoint.run');
});

test('visiting deployments page redirects to latest', async function (assert) {
Expand Down

0 comments on commit 64d0ccb

Please sign in to comment.