test(matchers): add support for toHaveClass in tests
This commit is contained in:
@ -11,6 +11,7 @@ import {
|
||||
containsRegexp
|
||||
} from 'angular2/test_lib';
|
||||
|
||||
import {DOM} from 'angular2/src/dom/dom_adapter';
|
||||
import {MapWrapper} from 'angular2/src/facade/collection';
|
||||
import {IMPLEMENTS, RegExpWrapper} from 'angular2/src/facade/lang';
|
||||
|
||||
@ -42,6 +43,20 @@ export function main() {
|
||||
});
|
||||
});
|
||||
|
||||
describe("toHaveCssClass", () => {
|
||||
it("should assert that the CSS class is present", () => {
|
||||
var el = DOM.createElement('div');
|
||||
DOM.addClass(el, 'matias');
|
||||
expect(el).toHaveCssClass('matias');
|
||||
});
|
||||
|
||||
it("should assert that the CSS class is not present", () => {
|
||||
var el = DOM.createElement('div');
|
||||
DOM.addClass(el, 'matias');
|
||||
expect(el).not.toHaveCssClass('fatias');
|
||||
});
|
||||
});
|
||||
|
||||
describe('toEqual for Maps', () => {
|
||||
it('should detect equality for same reference', () => {
|
||||
var m1 = MapWrapper.createFromStringMap({'a': 1});
|
||||
|
Reference in New Issue
Block a user