-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes nested wormholes and adds tests
- Loading branch information
Christopher Garrett
committed
Jun 28, 2016
1 parent
0e13a3b
commit 751b587
Showing
14 changed files
with
5,841 additions
and
11 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,31 @@ | ||
import { startApp, destroyApp } from '../helpers/app-lifecycle'; | ||
|
||
let app; | ||
|
||
module('Acceptance: Scenarios', { | ||
setup: function() { | ||
app = startApp(); | ||
}, | ||
|
||
teardown: function() { | ||
destroyApp(app); | ||
} | ||
}); | ||
|
||
test('nested tethers work properly', function() { | ||
visit('/scenarios/nested-wormholes'); | ||
|
||
click('button'); | ||
|
||
andThen(() => { | ||
const targets = $('.liquid-target-container').children(); | ||
|
||
const outerWormhole = targets.eq(0); | ||
const middleWormhole = targets.eq(1); | ||
const innerWormhole = targets.eq(2); | ||
|
||
ok(outerWormhole.hasClass('outer-wormhole-liquid-target'), 'Outer wormhole renders in correct order'); | ||
ok(middleWormhole.hasClass('middle-wormhole-liquid-target'), 'Middle wormhole renders in correct order'); | ||
ok(innerWormhole.hasClass('inner-wormhole-liquid-target'), 'Inner wormhole renders in correct order'); | ||
}); | ||
}); |
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 @@ | ||
import Ember from 'ember'; | ||
|
||
export default Ember.Controller.extend({ | ||
actions: { | ||
showInner() { | ||
this.toggleProperty('showingInner'); | ||
} | ||
} | ||
}); |
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
Empty file.
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 @@ | ||
{{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,21 @@ | ||
{{#liquid-wormhole to="outer-wormhole"}} | ||
<div class="green-box"> | ||
Outer Wormhole | ||
|
||
{{#liquid-wormhole to="middle-wormhole"}} | ||
<div class="blue-box"> | ||
Middle Wormhole | ||
|
||
<button {{action "showInner"}}>Show</button> | ||
|
||
{{#if showingInner}} | ||
{{#liquid-wormhole to="inner-wormhole"}} | ||
<div class="red-box"> | ||
Inner Wormhole | ||
</div> | ||
{{/liquid-wormhole}} | ||
{{/if}} | ||
</div> | ||
{{/liquid-wormhole}} | ||
</div> | ||
{{/liquid-wormhole}} |
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,25 @@ | ||
import Ember from 'ember'; | ||
import Application from '../../app'; | ||
import config from '../../config/environment'; | ||
|
||
export default startApp; | ||
|
||
export function startApp(attrs) { | ||
var application; | ||
|
||
var attributes = Ember.merge({}, config.APP); | ||
attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; | ||
|
||
Ember.run(function() { | ||
application = Application.create(attributes); | ||
application.setupForTesting(); | ||
application.injectTestHelpers(); | ||
}); | ||
|
||
return application; | ||
} | ||
|
||
export function destroyApp(app) { | ||
Ember.run(app, 'destroy'); | ||
Ember.$('.liquid-target-container').remove(); | ||
} |
Empty file.
Empty file.
Oops, something went wrong.