|
@@ -99,6 +99,19 @@ describe("<App /> shallow rendering", () => {
|
|
|
expect(App.prototype.componentWillReceiveProps.mock.calls.length).toBe(1);
|
|
|
expect(w.find(".lifeCycle").text()).toBe("componentWillReceiveProps");
|
|
|
});
|
|
|
+
|
|
|
+ it("should return correctly from handleStrings()", () => {
|
|
|
+
|
|
|
+ const expectations = {
|
|
|
+ "Hello, world": true,
|
|
|
+ "": false,
|
|
|
+ };
|
|
|
+
|
|
|
+ for (const [value, expected] of Object.entries(expectations)) {
|
|
|
+ const actual = wrapper.instance().handleStrings(value);
|
|
|
+ expect(actual).toBe(expected);
|
|
|
+ }
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
describe("<App /> mount rendering", () => {
|