-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from embroider-build/smoke-tests
Add smoke tests and fix the app-name.css link in index.html
- Loading branch information
Showing
16 changed files
with
152 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const walkSync = require('walk-sync'); | ||
const fs = require('fs'); | ||
const _ = require('lodash'); | ||
const { join, dirname } = require('path'); | ||
|
||
module.exports = function copyWithTemplate( | ||
sourceFolder, | ||
destinationFolder, | ||
templateContext, | ||
) { | ||
const files = walkSync(sourceFolder, { directories: false }); | ||
|
||
for (let file of files) { | ||
let content = _.template( | ||
fs.readFileSync(join(sourceFolder, file), 'utf-8'), | ||
)(templateContext); | ||
let destinationFile = join(destinationFolder, file); | ||
fs.mkdirSync(dirname(destinationFile), { recursive: true }); | ||
fs.writeFileSync(destinationFile, content); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import EmberRouter from '@ember/routing/router'; | ||
import config from '<%= name %>/config/environment'; | ||
|
||
export default class Router extends EmberRouter { | ||
location = config.locationType; | ||
rootURL = config.rootURL; | ||
} | ||
|
||
Router.map(function () { | ||
this.route('styles'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/* Ember supports plain CSS out of the box. More info: https://cli.emberjs.com/release/advanced-use/stylesheets/ */ | ||
|
||
.styles-test { | ||
background-color: blue; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{{page-title "FancyApp"}} | ||
|
||
{{outlet}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<WelcomePage /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<h1>Styles test</h1> | ||
|
||
<p class="styles-test"> | ||
I expect to be blue | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { module, test } from 'qunit'; | ||
import { visit } from '@ember/test-helpers'; | ||
import { setupApplicationTest } from '<%= name %>/tests/helpers'; | ||
|
||
module('Acceptance | styles', function (hooks) { | ||
setupApplicationTest(hooks); | ||
|
||
test('visiting /styles', async function (assert) { | ||
await visit('/styles'); | ||
|
||
assert.dom('.styles-test').hasStyle( | ||
{ | ||
'background-color': 'rgb(0, 0, 255)', | ||
}, | ||
'The background should be blue if the app styles are working correctly', | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { module, test } from 'qunit'; | ||
import { visit, currentURL } from '@ember/test-helpers'; | ||
import { setupApplicationTest } from '<%= name %>/tests/helpers'; | ||
|
||
module('Acceptance | welcome page', function (hooks) { | ||
setupApplicationTest(hooks); | ||
|
||
test('visiting /index shows the welcome page', async function (assert) { | ||
await visit('/'); | ||
|
||
assert.strictEqual(currentURL(), '/'); | ||
assert.dom('h1').containsText('Congratulations, you made it!'); | ||
}); | ||
}); |