-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests for addon merging in different scenarios
- Loading branch information
Showing
23 changed files
with
241 additions
and
16 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
3 changes: 3 additions & 0 deletions
3
tests/fixtures/addon/kitchen-sink-classic-mu-dummy-app/addon-test-support/helper.js
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 @@ | ||
export default function truthyHelper() { | ||
return true; | ||
} |
6 changes: 6 additions & 0 deletions
6
tests/fixtures/addon/kitchen-sink-classic-mu-dummy-app/addon/components/basic-thing.js
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,6 @@ | ||
import template from '../templates/components/basic-thing'; | ||
import Component from '@ember/component'; | ||
|
||
export default Component.extend({ | ||
layout: template | ||
}); |
1 change: 1 addition & 0 deletions
1
tests/fixtures/addon/kitchen-sink-classic-mu-dummy-app/addon/styles/app.css
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 @@ | ||
/* addon/styles/app.css is present */ |
3 changes: 3 additions & 0 deletions
3
...xtures/addon/kitchen-sink-classic-mu-dummy-app/addon/templates/components/basic-thing.hbs
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 @@ | ||
<div class="basic-thing"> | ||
{{yield}} | ||
</div> |
2 changes: 2 additions & 0 deletions
2
tests/fixtures/addon/kitchen-sink-classic-mu-dummy-app/app/components/basic-thing.js
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,2 @@ | ||
import BasicThing from 'some-cool-addon/components/basic-thing'; | ||
export default BasicThing; |
9 changes: 9 additions & 0 deletions
9
tests/fixtures/addon/kitchen-sink-classic-mu-dummy-app/index.js
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,9 @@ | ||
module.exports = { | ||
name: require('./package').name, | ||
|
||
contentFor(type, config) { | ||
if (type === 'head') { | ||
return '"SOME AWESOME STUFF"'; | ||
} | ||
} | ||
}; |
23 changes: 23 additions & 0 deletions
23
tests/fixtures/addon/kitchen-sink-classic-mu-dummy-app/tests/acceptance/main-test.js
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,23 @@ | ||
import { setupApplicationTest } from 'ember-qunit'; | ||
import { visit } from '@ember/test-helpers'; | ||
import truthyHelper from 'some-cool-addon/test-support/helper'; | ||
import { module, test } from 'qunit'; | ||
|
||
module('Acceptance', function(hooks) { | ||
setupApplicationTest(hooks); | ||
|
||
test('renders properly', async function(assert) { | ||
await visit('/'); | ||
|
||
var element = this.element.querySelector('.basic-thing'); | ||
assert.equal(element.textContent.trim(), 'WOOT!!'); | ||
assert.ok(truthyHelper(), 'addon-test-support helper'); | ||
}); | ||
|
||
test('renders imported component', async function(assert) { | ||
await visit('/'); | ||
|
||
var element = this.element.querySelector('.second-thing'); | ||
assert.equal(element.textContent.trim(), 'SECOND!!'); | ||
}); | ||
}); |
1 change: 1 addition & 0 deletions
1
tests/fixtures/addon/kitchen-sink-classic-mu-dummy-app/tests/dummy/public/robots.txt
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 @@ | ||
# tests/dummy/public/robots.txt is present |
5 changes: 5 additions & 0 deletions
5
...kitchen-sink-classic-mu-dummy-app/tests/dummy/src/ui/components/second-thing/component.js
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 @@ | ||
import BasicThing from 'some-cool-addon/components/basic-thing'; | ||
|
||
export default BasicThing.extend({ | ||
classNames: ['second-thing'] | ||
}); |
2 changes: 2 additions & 0 deletions
2
...ddon/kitchen-sink-classic-mu-dummy-app/tests/dummy/src/ui/routes/application/template.hbs
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,2 @@ | ||
{{#basic-thing}}WOOT!!{{/basic-thing}} | ||
{{#second-thing}}SECOND!!{{/second-thing}} |
3 changes: 3 additions & 0 deletions
3
tests/fixtures/addon/kitchen-sink-mu-classic-dummy-app/addon-test-support/helper.js
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 @@ | ||
export default function truthyHelper() { | ||
return true; | ||
} |
9 changes: 9 additions & 0 deletions
9
tests/fixtures/addon/kitchen-sink-mu-classic-dummy-app/index.js
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,9 @@ | ||
module.exports = { | ||
name: require('./package').name, | ||
|
||
contentFor(type, config) { | ||
if (type === 'head') { | ||
return '"SOME AWESOME STUFF"'; | ||
} | ||
} | ||
}; |
6 changes: 6 additions & 0 deletions
6
...xtures/addon/kitchen-sink-mu-classic-dummy-app/src/ui/components/basic-thing/component.js
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,6 @@ | ||
import template from './template'; | ||
import Component from '@ember/component'; | ||
|
||
export default Component.extend({ | ||
layout: template | ||
}); |
3 changes: 3 additions & 0 deletions
3
...xtures/addon/kitchen-sink-mu-classic-dummy-app/src/ui/components/basic-thing/template.hbs
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 @@ | ||
<div class="basic-thing"> | ||
{{yield}} | ||
</div> |
1 change: 1 addition & 0 deletions
1
tests/fixtures/addon/kitchen-sink-mu-classic-dummy-app/src/ui/styles/app.css
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 @@ | ||
/* addon/styles/app.css is present */ |
23 changes: 23 additions & 0 deletions
23
tests/fixtures/addon/kitchen-sink-mu-classic-dummy-app/tests/acceptance/main-test.js
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,23 @@ | ||
import { setupApplicationTest } from 'ember-qunit'; | ||
import { visit } from '@ember/test-helpers'; | ||
import truthyHelper from 'some-cool-addon/test-support/helper'; | ||
import { module, test } from 'qunit'; | ||
|
||
module('Acceptance', function(hooks) { | ||
setupApplicationTest(hooks); | ||
|
||
test('renders properly', async function(assert) { | ||
await visit('/'); | ||
|
||
var element = this.element.querySelector('.basic-thing'); | ||
assert.equal(element.textContent.trim(), 'WOOT!!'); | ||
assert.ok(truthyHelper(), 'addon-test-support helper'); | ||
}); | ||
|
||
test('renders imported component', async function(assert) { | ||
await visit('/'); | ||
|
||
var element = this.element.querySelector('.second-thing'); | ||
assert.equal(element.textContent.trim(), 'SECOND!!'); | ||
}); | ||
}); |
5 changes: 5 additions & 0 deletions
5
...on/kitchen-sink-mu-classic-dummy-app/tests/dummy/app/components/second-thing/component.js
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 @@ | ||
import BasicThing from 'some-cool-addon/src/ui/components/basic-thing/component'; | ||
|
||
export default BasicThing.extend({ | ||
classNames: ['second-thing'] | ||
}); |
2 changes: 2 additions & 0 deletions
2
...ixtures/addon/kitchen-sink-mu-classic-dummy-app/tests/dummy/app/templates/application.hbs
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,2 @@ | ||
{{#basic-thing}}WOOT!!{{/basic-thing}} | ||
{{#second-thing}}SECOND!!{{/second-thing}} |
1 change: 1 addition & 0 deletions
1
tests/fixtures/addon/kitchen-sink-mu-classic-dummy-app/tests/dummy/public/robots.txt
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 @@ | ||
# tests/dummy/public/robots.txt is present |
2 changes: 1 addition & 1 deletion
2
tests/fixtures/addon/kitchen-sink-mu/tests/dummy/src/ui/routes/application/template.hbs
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
{{#basic-thing}}WOOT!!{{/basic-thing}} | ||
<SomeCoolAddon::BasicThing>WOOT!!</SomeCoolAddon::BasicThing> | ||
{{#second-thing}}SECOND!!{{/second-thing}} |