it("shouldn't fetch repos on mount if username is empty", () => { store.dispatch(actions.changeUsername('')); store.dispatch(actions.reposLoaded([])); component.unmount(); component = renderGithubRepoForm(store); expect(store.getState().githubRepoForm.loading).toBe(false); });
expect(slice.reducer(state, slice.actions.changeUsername(text))).toEqual({ ...slice.initialState, username: text,
dispatch(actions.changeUsername(evt.currentTarget.value)); dispatch(actions.loadRepos()); };
it("shouldn't fetch repos on mount if username is empty", () => { store.dispatch(actions.changeUsername('')); store.dispatch(actions.reposLoaded([])); component.unmount(); component = renderGithubRepoForm(store); expect(store.getState().githubRepoForm.loading).toBe(false); });
expect(slice.reducer(state, slice.actions.changeUsername(text))).toEqual({ ...slice.initialState, username: text,
dispatch(actions.changeUsername(evt.currentTarget.value)); dispatch(actions.loadRepos()); };