mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
fix(chai-dom): add missing visible assertion (#43584)
This commit is contained in:
parent
28ac63301b
commit
fb647dc611
@ -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;
|
||||
}
|
||||
|
||||
18
types/chai-dom/index.d.ts
vendored
18
types/chai-dom/index.d.ts
vendored
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user