use new jasmine async code
This commit is contained in:
parent
d4aca571ac
commit
304e560e43
1 changed files with 11 additions and 8 deletions
|
|
@ -82,20 +82,23 @@ describe("app.views.Header", function() {
|
|||
});
|
||||
|
||||
describe("focus", function() {
|
||||
it("adds the class 'active' when the user focuses the text field", function() {
|
||||
beforeEach(function(done){
|
||||
input.trigger('focusin');
|
||||
waitsFor(function() {
|
||||
return input.is('.active');
|
||||
});
|
||||
runs(function() {
|
||||
expect(input).toHaveClass("active");
|
||||
});
|
||||
done();
|
||||
});
|
||||
|
||||
it("adds the class 'active' when the user focuses the text field", function() {
|
||||
expect(input).toHaveClass("active");
|
||||
});
|
||||
});
|
||||
|
||||
describe("blur", function() {
|
||||
it("removes the class 'active' when the user blurs the text field", function() {
|
||||
beforeEach(function(done) {
|
||||
input.trigger('focusin').trigger('focusout');
|
||||
done();
|
||||
});
|
||||
|
||||
it("removes the class 'active' when the user blurs the text field", function() {
|
||||
expect(input).not.toHaveClass("active");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue