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 #27 from runspired/feat/sustain-labels
feat(label): implements labels and tests, resolves #16
- Loading branch information
Showing
9 changed files
with
114 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { test } from 'qunit'; | ||
import moduleForAcceptance from '../../tests/helpers/module-for-acceptance'; | ||
|
||
moduleForAcceptance('Acceptance | sustain labels'); | ||
|
||
test('Testing that multiple instances of a component can be sustained when labels are used.', function(assert) { | ||
visit('/tests/sustain-labels'); | ||
|
||
andThen(function() { | ||
assert.equal(currentURL(), '/tests/sustain-labels'); | ||
|
||
let text = find('h1').eq(0).text(); | ||
let text1 = find('h1').eq(1).text(); | ||
let text2 = find('h1').eq(2).text(); | ||
|
||
assert.equal(text, 'Rendered!', 'We rendered without a label'); | ||
assert.equal(text1, 'Rendered!', 'We rendered again with a label'); | ||
assert.equal(text2, 'Rendered!', 'We rendered again with a new label'); | ||
}); | ||
|
||
}); | ||
|
||
|
||
test('Testing that a labeled component is recycled.', function(assert) { | ||
visit('/tests/sustain-labels-2'); | ||
|
||
andThen(function() { | ||
assert.equal(currentURL(), '/tests/sustain-labels-2'); | ||
|
||
let text1 = find('.label-test-condition').eq(0).find('h1').text(); | ||
let text2 = find('.label-test-condition').eq(1).find('h1').text(); | ||
let text3 = find('.label-test-condition').eq(2).find('h1').text(); | ||
let text4 = find('.label-test-condition').eq(3).find('h1').text(); | ||
|
||
assert.equal(text1, '', 'We rendered nothing to the first marker (no label)'); | ||
assert.equal(text2, '', 'We rendered nothing to the second marker (which had a label)'); | ||
assert.equal(text3, 'Rendered!', 'We rendered to the third marker (no label)'); | ||
assert.equal(text4, 'Rendered!', 'We rendered to the fourth marker (which had a label)'); | ||
}); | ||
|
||
}); |
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,4 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Route.extend({ | ||
}); |
15 changes: 15 additions & 0 deletions
15
tests/dummy/app/routes/tests/sustain-labels-2/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,15 @@ | ||
{{!-- initial location --}} | ||
<div class="label-test-condition"> | ||
{{sustain "tests/components/missing-layout"}} | ||
</div> | ||
<div class="label-test-condition"> | ||
{{sustain "tests/components/missing-layout" label="label-test-1"}} | ||
</div> | ||
|
||
{{!-- final location --}} | ||
<div class="label-test-condition"> | ||
{{sustain "tests/components/missing-layout"}} | ||
</div> | ||
<div class="label-test-condition"> | ||
{{sustain "tests/components/missing-layout" label="label-test-1"}} | ||
</div> |
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,4 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Route.extend({ | ||
}); |
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 @@ | ||
{{sustain "tests/components/missing-layout"}} | ||
{{sustain "tests/components/missing-layout" label="label-test-1"}} | ||
{{sustain "tests/components/missing-layout" label="label-test-2"}} |