fix(chai-dom): add missing visible assertion (#43584)

This commit is contained in:
Thomas Allmer 2020-04-03 19:27:58 +02:00 committed by GitHub
parent 28ac63301b
commit fb647dc611
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 15 deletions

View File

@ -5,7 +5,6 @@ chai.use(chaiDom);
var expect = chai.expect;
function test() {
var testElement = '<div></div>';
expect(testElement).to.have.attribute('foo', 'bar');
expect(testElement).to.have.attr('foo').match(/bar/);
@ -22,5 +21,5 @@ function test() {
expect(testElement).to.match('foo');
expect(testElement).to.contain('foo');
expect(testElement).to.contain(document.body);
}
expect(testElement).to.be.visible;
}

View File

@ -7,9 +7,7 @@
/// <reference types="chai" />
declare namespace Chai {
interface Assertion {
attr(name: string, value?: string): Assertion;
attribute(name: string, value?: string): Assertion;
@ -20,7 +18,7 @@ declare namespace Chai {
html(html: string): Assertion;
text(text: string|string[]): Assertion;
text(text: string | string[]): Assertion;
value(text: string): Assertion;
@ -30,7 +28,7 @@ declare namespace Chai {
// same type or a more general type, so don't need to be re-declared even though
// the implementation is different
descendant(element: string|HTMLElement): Assertion;
descendant(element: string | HTMLElement): Assertion;
descendants(selector: string): Assertion;
@ -38,25 +36,21 @@ declare namespace Chai {
trimmed: Assertion;
visible: Assertion;
}
interface Include {
text(text: string | string[]): Assertion;
text(text: string|string[]): Assertion;
html(text: string|string[]): Assertion;
html(text: string | string[]): Assertion;
}
interface Match {
(selector: string): Assertion;
}
}
declare module "chai-dom" {
declare module 'chai-dom' {
const chaiDom: Chai.ChaiPlugin;
export = chaiDom;
}