Skip to content

Commit

Permalink
Added test for canary-test-results route
Browse files Browse the repository at this point in the history
  • Loading branch information
yohanmishkin committed Mar 5, 2019
1 parent 03ffeee commit 2523c87
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
1 change: 0 additions & 1 deletion tests/acceptance/addons-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ module('Acceptance: Addons', function(hooks) {
assert.equal(currentURL(), '/addons/test-addon/correct', 'suggest a correction link works');
});


module('Scoped addons', function(hooks) {
hooks.beforeEach(function() {
this.addon = server.create('addon', {
Expand Down
27 changes: 27 additions & 0 deletions tests/acceptance/canary-test-results-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { currentRouteName, visit } from '@ember/test-helpers';
import { module, test } from 'qunit';
import { percySnapshot } from 'ember-percy';
import { setupEmberObserverTest } from '../helpers/setup-ember-observer-test';
import moment from 'moment';

module('Acceptance | canary test results', function(hooks) {
setupEmberObserverTest(hooks);

test('redirects to current day', async function(assert) {
let addon = server.create('addon');

let addonVersion = server.create('version', { addonId: addon.id });

server.create('testResult', {
versionId: addonVersion.id,
canary: true,
createdAt: moment('2016-08-07 16:30').utc()
});

await visit('/canary-test-results');

await percySnapshot('/canary-test-results/date');

assert.equal(currentRouteName(), 'canary-test-results.date', 'transitions to canary test results date route');
});
});

0 comments on commit 2523c87

Please sign in to comment.