|
| 1 | +import { module, test } from 'qunit'; |
| 2 | + |
| 3 | +import { setupApplicationTest } from 'cargo/tests/helpers'; |
| 4 | + |
| 5 | +import { visit } from '../helpers/visit-ignoring-abort'; |
| 6 | + |
| 7 | +let s = new URLSearchParams(window.location.search); |
| 8 | +if (s.has('devmode')) { |
| 9 | + /** |
| 10 | + * This module will only be available if the "Development Mode" option of QUnit is chosen |
| 11 | + * @link http://localhost:4200/tests/?notrycatch&devmode&filter=Development%20Mode |
| 12 | + */ |
| 13 | + module('Development Mode', function (hooks) { |
| 14 | + setupApplicationTest(hooks); |
| 15 | + |
| 16 | + test('authenticated', async function () { |
| 17 | + let user = this.server.create('user'); |
| 18 | + this.authenticateAs(user); |
| 19 | + |
| 20 | + let crate = this.server.create('crate', { name: 'foo' }); |
| 21 | + this.server.create('version', { crate, num: '0.1.0' }); |
| 22 | + this.server.create('crate-ownership', { crate, user }); |
| 23 | + |
| 24 | + crate = this.server.create('crate', { name: 'bar' }); |
| 25 | + this.server.create('version', { crate, num: '1.0.0' }); |
| 26 | + |
| 27 | + let router = this.owner.lookup('service:router'); |
| 28 | + router.on('routeDidChange', () => { |
| 29 | + console.log(`URL: ${router.currentURL}`); |
| 30 | + }); |
| 31 | + |
| 32 | + await visit('/'); |
| 33 | + // eslint-disable-next-line ember/no-pause-test |
| 34 | + await this.pauseTest(); |
| 35 | + }); |
| 36 | + }); |
| 37 | +} |
0 commit comments