Skip to content

Commit

Permalink
Merge pull request #73 from Turbo87/fastboot-tests
Browse files Browse the repository at this point in the history
Modernise and fix fastboot tests
  • Loading branch information
Turbo87 committed Nov 13, 2019
2 parents 8763e15 + 3b11a45 commit 6895a27
Show file tree
Hide file tree
Showing 5 changed files with 3,523 additions and 360 deletions.
8 changes: 0 additions & 8 deletions fastboot-server/server.js

This file was deleted.

23 changes: 0 additions & 23 deletions fastboot-tests/ember-cli-ifa-test.js

This file was deleted.

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"ember-cli-app-version": "^3.1.3",
"ember-cli-dependency-checker": "^2.1.0",
"ember-cli-fastboot": "^1.1.3",
"ember-cli-fastboot-testing": "^0.2.3",
"ember-cli-htmlbars": "^2.0.3",
"ember-cli-htmlbars-inline-precompile": "^1.0.2",
"ember-cli-inject-live-reload": "^1.7.0",
Expand All @@ -42,7 +43,6 @@
"ember-cli-uglify": "^2.0.0",
"ember-disable-prototype-extensions": "^1.1.3",
"ember-export-application-global": "^2.0.0",
"ember-fastboot-test-helpers": "^0.2.0",
"ember-load-initializers": "^1.0.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-resolver": "^4.5.0",
Expand All @@ -54,9 +54,6 @@
"eslint-plugin-ember": "^5.0.3",
"eslint-plugin-node": "^6.0.0",
"eslint-plugin-prettier": "^3.1.1",
"fastboot": "^1.1.3",
"fastboot-app-server": "^1.1.0",
"jsdom": "^11.6.2",
"loader.js": "^4.6.0",
"prettier": "^1.19.1",
"qunit-dom": "^0.9.1"
Expand Down
40 changes: 40 additions & 0 deletions tests/fastboot/fastboot-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { module, test } from 'qunit';
import { setup as setupFastBootTest, visit } from 'ember-cli-fastboot-testing/test-support';

module('FastBoot', function(hooks) {
setupFastBootTest(hooks);

test('renders the correct asset URLs', async function(assert) {
const { statusCode, err } = await visit('/');

assert.equal(200, statusCode, err ? err.message : '');

assert
.dom('[data-test-img-template-replace]')
.hasAttribute(
'src',
'assets/tomster-under-construction-da524c8bc9283f759ae640b68db81f24.png'
);

assert
.dom('[data-test-img-asset-map-service]')
.hasAttribute(
'src',
'assets/tomster-under-construction-da524c8bc9283f759ae640b68db81f24.png'
);

assert
.dom('[data-test-img-asset-map-helper]')
.hasAttribute(
'src',
'assets/tomster-under-construction-da524c8bc9283f759ae640b68db81f24.png'
);

assert
.dom('[data-test-img-asset-map-helper-string-path]')
.hasAttribute(
'src',
'assets/tomster-under-construction-da524c8bc9283f759ae640b68db81f24.png'
);
});
});

0 comments on commit 6895a27

Please sign in to comment.