[chai-enzyme] Add support for version 0.6.1

This commit is contained in:
Christian Treppo
2017-02-15 15:44:20 +01:00
parent e79e2e64a6
commit 69c3d510d8
2 changed files with 22 additions and 1 deletions

View File

@@ -40,5 +40,8 @@ expect(wrapper).to.have.data("test", "Test");
expect(wrapper).to.have.style("background", "green");
expect(wrapper).to.have.state("test", "test");
expect(wrapper).to.have.prop("test", 5);
expect(wrapper).to.have.props(["test1", "test2"]);
expect(wrapper).to.have.props({ test: 5 });
expect(wrapper).to.contain(<Test/>);
expect(wrapper).to.containMatchingElement(<Test/>);
expect(wrapper).to.match(<Test/>);

View File

@@ -1,4 +1,4 @@
// Type definitions for chai-enzyme 0.5.0
// Type definitions for chai-enzyme 0.6.1
// Project: https://github.com/producthunt/chai-enzyme
// Definitions by: Alexey Svetliakov <https://github.com/asvetliakov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -39,6 +39,12 @@ declare namespace Chai {
*/
className(name: string): Assertion;
/**
* Assert that the wrapper contains a certain element:
* @param selector
*/
containMatchingElement(selector: EnzymeSelector): Assertion;
/**
* Assert that the wrapper contains a descendant matching the given selector:
* @param selector
@@ -140,6 +146,18 @@ declare namespace Chai {
* @param val
*/
prop(key: string, val?: any): Assertion;
/**
* Assert that the wrapper has given props [with values]:
* @param keys
*/
props(keys: string[]): Assertion;
/**
* Assert that the wrapper has given props [with values]:
* @param props
*/
props(props: EnzymeSelector): Assertion;
}
}