This repository has been archived by the owner on Oct 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Port all test specifications to the new test stack #28
- Loading branch information
1 parent
a5087b1
commit 4112a15
Showing
38 changed files
with
601 additions
and
518 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
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
var chai = require('@reduct/build-tools').chai; | ||
var DOM = require('./../Helpers/DOM'); | ||
var DefaultComponent = require('./../ExampleComponents/Dist/Default.js'); | ||
var expect = chai.expect; | ||
|
||
describe('@reduct/component: Element API', function () { | ||
beforeEach(function before (done) { | ||
return DOM.create(DOM.defaultMock, done); | ||
}); | ||
|
||
it('should return a DOM element even if none was passed directly to the Constructor.', function () { | ||
var componentInstance = new DefaultComponent(); | ||
|
||
expect(componentInstance.getElement()).to.not.be.undefined; | ||
}); | ||
}); |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
var chai = require('@reduct/build-tools').chai; | ||
var spies = require('chai-spies'); | ||
var DOM = require('./../Helpers/DOM'); | ||
var DefaultComponent = require('./../ExampleComponents/Dist/Default.js'); | ||
var expect = chai.expect; | ||
|
||
chai.use(spies); | ||
|
||
describe('@reduct/component: Events API', function () { | ||
var instance; | ||
var eventCallback; | ||
|
||
beforeEach(function before (done) { | ||
instance = new DefaultComponent(); | ||
eventCallback = chai.spy(function (arg) { }); | ||
|
||
return DOM.create(DOM.defaultMock, done); | ||
}); | ||
|
||
it('should listen to the trigger event and execute the callback with the provided argument.', function () { | ||
|
||
instance.on('myEvent', eventCallback); | ||
instance.trigger('myEvent', 1); | ||
|
||
expect(eventCallback).to.have.been.called.with(1); | ||
}); | ||
|
||
it('should remove the given function from the event queue.', function () { | ||
instance.on('myEvent', eventCallback); | ||
instance.off('myEvent', eventCallback); | ||
instance.trigger('myEvent', 1); | ||
|
||
expect(eventCallback).to.not.have.been.called.with(1); | ||
}); | ||
|
||
afterEach(function () { | ||
instance = null; | ||
eventCallback = null; | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.