mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-11 11:50:54 +08:00
Fix chai-jquery tests
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
/// <reference path="../chai/chai.d.ts" />
|
||||
/// <reference path="chai-jquery.d.ts" />
|
||||
|
||||
// tests taken from https://github.com/chaijs/chai-jquery
|
||||
|
||||
declare var $;
|
||||
var expect = chai.expect;
|
||||
|
||||
@@ -17,6 +19,7 @@ function test_css() {
|
||||
function test_data() {
|
||||
expect($('#foo')).to.have.data('toggle');
|
||||
expect($('#foo')).to.have.css('toggle', 'true');
|
||||
expect($('body')).to.have.css('font-family').match(/sans-serif/);
|
||||
}
|
||||
|
||||
function test_class() {
|
||||
@@ -59,10 +62,30 @@ function test_disabled() {
|
||||
expect($('#foo')).to.be.disabled;
|
||||
}
|
||||
|
||||
function test_empty() {
|
||||
$('.empty').should.be.empty;
|
||||
expect($('body')).not.to.be.empty;
|
||||
}
|
||||
|
||||
function test_exist() {
|
||||
$('#exists').should.exist;
|
||||
expect($('#nonexistent')).not.to.exist;
|
||||
}
|
||||
|
||||
function test_match_selector() {
|
||||
$('input').should.match('#foo');
|
||||
}
|
||||
|
||||
function test_contain() {
|
||||
$('body').should.contain('text');
|
||||
expect($('#content')).to.contain('text');
|
||||
}
|
||||
|
||||
function test_be_selector() {
|
||||
expect($('#foo')).to.be(':empty');
|
||||
}
|
||||
|
||||
function test_have_selector() {
|
||||
$('body').should.have('h1');
|
||||
expect($('#foo')).to.have('div');
|
||||
}
|
||||
Reference in New Issue
Block a user