From d973dc05b90907c12ae9309ae47546208da7eae9 Mon Sep 17 00:00:00 2001 From: Nikolay Ermolaev <44134625+abscess@users.noreply.github.com> Date: Mon, 30 Mar 2020 19:30:38 +0300 Subject: [PATCH] update tests --- Tags/__tests__/Tags_enzyme-tests.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Tags/__tests__/Tags_enzyme-tests.js b/Tags/__tests__/Tags_enzyme-tests.js index fa3259f..c0fc677 100644 --- a/Tags/__tests__/Tags_enzyme-tests.js +++ b/Tags/__tests__/Tags_enzyme-tests.js @@ -16,7 +16,7 @@ describe("Tags", () => { wrapper .find("Tag") .at(1) - .simulate("press"); + .simulate("press", { persist: jest.fn()}); expect(wrapper.find("Tag").length).toEqual(3); }); @@ -32,18 +32,18 @@ describe("Tags", () => { wrapper .find("Tag") .at(0) - .simulate("press"); + .simulate("press", { persist: jest.fn()}); expect(wrapper.find("Tag").length).toEqual(4); }); }); - describe("TextInput", () => { + describe("Input", () => { describe("onChangeText", () => { it("should add a new tag when a space, or comma is detected", () => { const onChangeTags = jest.fn(); const wrapper = shallow().find( - "TextInput" + "Input" ); wrapper.simulate("ChangeText", "dog "); expect(onChangeTags.mock.calls).toEqual([[["dog"]]]); @@ -55,7 +55,7 @@ describe("Tags", () => { const onChangeTags = jest.fn(); const wrapper = shallow( - ).find("TextInput"); + ).find("Input"); wrapper.simulate("ChangeText", "dog"); wrapper.simulate("SubmitEditing"); expect(onChangeTags.mock.calls).toEqual([[["dog"]]]); @@ -64,7 +64,7 @@ describe("Tags", () => { it("should remove a tag when the text is empty", () => { const onChangeTags = jest.fn(); const wrapper = shallow().find( - "TextInput" + "Input" ); wrapper.simulate("ChangeText", "dog "); expect(onChangeTags.mock.calls).toEqual([[["dog"]]]); @@ -73,16 +73,16 @@ describe("Tags", () => { }); it("text input should not be available if it's readyonly", () => { - const wrapper = shallow().find("TextInput"); + const wrapper = shallow().find("Input"); expect(wrapper.length).toEqual(0); }); - it("textinput should dissapear after maxNumberOfTags is reached", () => { + it("input should dissapear after maxNumberOfTags is reached", () => { const wrapper = shallow( ); - wrapper.find("TextInput").simulate("ChangeText", "dog "); - expect(wrapper.find("TextInput").length).toEqual(0); + wrapper.find("Input").simulate("ChangeText", "dog "); + expect(wrapper.find("Input").length).toEqual(0); }); }); });