[ARVADOS-WORKBENCH2] updated: 1.2.0-562-ge7a7228

Git user git at public.curoverse.com
Tue Oct 9 05:59:32 EDT 2018


Summary of changes:
 .../search-bar/search-bar-view.test.tsx            | 85 ++++++++++++++++++++--
 1 file changed, 77 insertions(+), 8 deletions(-)

       via  e7a722835aeda5ebe0eeab2328a7e628927e6416 (commit)
      from  da3ae51b7b3b63561a9e1c47c965f45a08225d34 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit e7a722835aeda5ebe0eeab2328a7e628927e6416
Author: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>
Date:   Tue Oct 9 11:59:13 2018 +0200

    tests fix
    
    Feature #14313
    
    Arvados-DCO-1.1-Signed-off-by: Pawel Kowalczyk <pawel.kowalczyk at contractors.roche.com>

diff --git a/src/views-components/search-bar/search-bar-view.test.tsx b/src/views-components/search-bar/search-bar-view.test.tsx
index 4230aa8..de1e961 100644
--- a/src/views-components/search-bar/search-bar-view.test.tsx
+++ b/src/views-components/search-bar/search-bar-view.test.tsx
@@ -8,6 +8,7 @@ import { SearchBarView, DEFAULT_SEARCH_DEBOUNCE } from "./search-bar-view";
 
 import * as Adapter from 'enzyme-adapter-react-16';
 
+
 configure({ adapter: new Adapter() });
 
 describe("<SearchBar />", () => {
@@ -22,20 +23,44 @@ describe("<SearchBar />", () => {
 
     describe("on submit", () => {
         it("calls onSearch with initial value passed via props", () => {
-            const searchBar = mount(<SearchBarView value="initial value" onSearch={onSearch} currentView='' open={true} onSetView={jest.fn()} openView={jest.fn()} closeView={jest.fn()} />);
+            const searchBar = mount(<SearchBarView value="initial value"
+                onSearch={onSearch}
+                currentView=''
+                open={true}
+                onSetView={jest.fn()}
+                openView={jest.fn()}
+                closeView={jest.fn()}
+                saveQuery={jest.fn()}
+                loadQueries={() => ['test']} />);
             searchBar.find("form").simulate("submit");
             expect(onSearch).toBeCalledWith("initial value");
         });
 
         it("calls onSearch with current value", () => {
-            const searchBar = mount(<SearchBarView value="" onSearch={onSearch} currentView='' open={true} onSetView={jest.fn()} openView={jest.fn()} closeView={jest.fn()} />);
+            const searchBar = mount(<SearchBarView value=""
+                onSearch={onSearch}
+                currentView=''
+                open={true}
+                onSetView={jest.fn()}
+                openView={jest.fn()}
+                closeView={jest.fn()}
+                saveQuery={jest.fn()}
+                loadQueries={() => ['test']} />);
             searchBar.find("input").simulate("change", { target: { value: "current value" } });
             searchBar.find("form").simulate("submit");
             expect(onSearch).toBeCalledWith("current value");
         });
 
         it("calls onSearch with new value passed via props", () => {
-            const searchBar = mount(<SearchBarView value="" onSearch={onSearch} currentView='' open={true} onSetView={jest.fn()} openView={jest.fn()} closeView={jest.fn()} />);
+            const searchBar = mount(<SearchBarView value=""
+                onSearch={onSearch}
+                currentView=''
+                open={true}
+                onSetView={jest.fn()}
+                openView={jest.fn()}
+                closeView={jest.fn()}
+                saveQuery={jest.fn()}
+                loadQueries={() => ['test']} />);
             searchBar.find("input").simulate("change", { target: { value: "current value" } });
             searchBar.setProps({ value: "new value" });
             searchBar.find("form").simulate("submit");
@@ -43,7 +68,16 @@ describe("<SearchBar />", () => {
         });
 
         it("cancels timeout set on input value change", () => {
-            const searchBar = mount(<SearchBarView value="" onSearch={onSearch} debounce={1000} currentView='' open={true} onSetView={jest.fn()} openView={jest.fn()} closeView={jest.fn()} />);
+            const searchBar = mount(<SearchBarView value=""
+                onSearch={onSearch}
+                debounce={1000}
+                currentView=''
+                open={true}
+                onSetView={jest.fn()}
+                openView={jest.fn()}
+                closeView={jest.fn()}
+                saveQuery={jest.fn()}
+                loadQueries={() => ['test']} />);
             searchBar.find("input").simulate("change", { target: { value: "current value" } });
             searchBar.find("form").simulate("submit");
             jest.runTimersToTime(1000);
@@ -55,7 +89,15 @@ describe("<SearchBar />", () => {
 
     describe("on input value change", () => {
         it("calls onSearch after default timeout", () => {
-            const searchBar = mount(<SearchBarView value="" onSearch={onSearch} currentView='' open={true} onSetView={jest.fn()} openView={jest.fn()} closeView={jest.fn()} />);
+            const searchBar = mount(<SearchBarView value=""
+                onSearch={onSearch}
+                currentView=''
+                open={true}
+                onSetView={jest.fn()}
+                openView={jest.fn()}
+                closeView={jest.fn()}
+                saveQuery={jest.fn()}
+                loadQueries={() => ['test']} />);
             searchBar.find("input").simulate("change", { target: { value: "current value" } });
             expect(onSearch).not.toBeCalled();
             jest.runTimersToTime(DEFAULT_SEARCH_DEBOUNCE);
@@ -63,7 +105,16 @@ describe("<SearchBar />", () => {
         });
 
         it("calls onSearch after the time specified in props has passed", () => {
-            const searchBar = mount(<SearchBarView value="" onSearch={onSearch} debounce={2000} currentView='' open={true} onSetView={jest.fn()} openView={jest.fn()} closeView={jest.fn()} />);
+            const searchBar = mount(<SearchBarView value=""
+                onSearch={onSearch}
+                debounce={2000}
+                currentView=''
+                open={true}
+                onSetView={jest.fn()}
+                openView={jest.fn()}
+                closeView={jest.fn()}
+                saveQuery={jest.fn()}
+                loadQueries={() => ['test']} />);
             searchBar.find("input").simulate("change", { target: { value: "current value" } });
             jest.runTimersToTime(1000);
             expect(onSearch).not.toBeCalled();
@@ -72,7 +123,16 @@ describe("<SearchBar />", () => {
         });
 
         it("calls onSearch only once after no change happened during the specified time", () => {
-            const searchBar = mount(<SearchBarView value="" onSearch={onSearch} debounce={1000} currentView='' open={true} onSetView={jest.fn()} openView={jest.fn()} closeView={jest.fn()} />);
+            const searchBar = mount(<SearchBarView value=""
+                onSearch={onSearch}
+                debounce={1000}
+                currentView=''
+                open={true}
+                onSetView={jest.fn()}
+                openView={jest.fn()}
+                closeView={jest.fn()}
+                saveQuery={jest.fn()}
+                loadQueries={() => ['test']} />);
             searchBar.find("input").simulate("change", { target: { value: "current value" } });
             jest.runTimersToTime(500);
             searchBar.find("input").simulate("change", { target: { value: "changed value" } });
@@ -81,7 +141,16 @@ describe("<SearchBar />", () => {
         });
 
         it("calls onSearch again after the specified time has passed since previous call", () => {
-            const searchBar = mount(<SearchBarView value="" onSearch={onSearch} debounce={1000} currentView='' open={true} onSetView={jest.fn()} openView={jest.fn()} closeView={jest.fn()} />);
+            const searchBar = mount(<SearchBarView value=""
+                onSearch={onSearch}
+                debounce={1000}
+                currentView=''
+                open={true}
+                onSetView={jest.fn()}
+                openView={jest.fn()}
+                closeView={jest.fn()}
+                saveQuery={jest.fn()}
+                loadQueries={() => ['test']} />);
             searchBar.find("input").simulate("change", { target: { value: "current value" } });
             jest.runTimersToTime(500);
             searchBar.find("input").simulate("change", { target: { value: "intermediate value" } });

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list