-
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update actions to kebob case & arguments. (#159)
* Update actions to kebob case & arguments. Now we send the same arguments for all of the actions. The value of the select & the event. * Update to closure actions only * Clarify readme for `componentState` * Send warning for string actions & remove componentState
- Loading branch information
Showing
14 changed files
with
172 additions
and
146 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
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
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,45 @@ | ||
/* jshint expr:true */ | ||
import { expect } from 'chai'; | ||
import { describeComponent, it } from 'ember-mocha'; | ||
import { describe, beforeEach } from 'mocha'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
|
||
describeComponent( | ||
'default-value', | ||
'Integration: DefaultValue', | ||
{ | ||
integration: true | ||
}, | ||
function() { | ||
describe("default value of null", function() { | ||
beforeEach(function() { | ||
this.set('make', null); | ||
this.set('selectAction', (value) => { | ||
this.set("make", value); | ||
this.set("wasCalled", true); | ||
}); | ||
|
||
this.render(hbs` | ||
{{#x-select value=make action=selectAction as |xs|}} | ||
{{#xs.option value="fordValue" class="spec-ford-option"}}Ford{{/xs.option}} | ||
{{#xs.option value="chevyValue"}}Chevy{{/xs.option}} | ||
{{#xs.option value="dodgeValue" class="spec-dodge-option"}}Dodge{{/xs.option}} | ||
{{/x-select}} | ||
`); | ||
}); | ||
|
||
it("displays the first item in the list", function() { | ||
expect(this.$('select option:selected').text()).to.equal("Ford"); | ||
}); | ||
|
||
it("sets the default value to the first element", function() { | ||
expect(this.get('make')).to.equal("fordValue"); | ||
}); | ||
|
||
it("invokes the select action on init", function() { | ||
expect(this.get("wasCalled")).to.equal(true); | ||
}); | ||
|
||
}); | ||
} | ||
); |
Oops, something went wrong.