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); });
beforeEach(() => { store = configureAppStore(); component = renderGithubRepoForm(store); store.dispatch(actions.reposLoaded([])); expect(store.getState().githubRepoForm).toEqual(initialState); });
it('should display list when repos not empty', () => { const repoName = 'testRepo'; store.dispatch(actions.reposLoaded([{ id: 'test', name: repoName }])); expect(component.queryByText(repoName)).toBeInTheDocument(); });
yield put(actions.reposLoaded(repos)); } else { yield put(actions.repoError(RepoErrorType.USER_HAS_NO_REPO));
expect(slice.reducer(state, slice.actions.reposLoaded(repos))).toEqual({ ...slice.initialState, loading: false,
expect(putDescriptor).toEqual(put(slice.actions.reposLoaded(repos))); });
beforeEach(() => { store = configureAppStore(); component = renderGithubRepoForm(store); store.dispatch(actions.reposLoaded([])); expect(store.getState().githubRepoForm).toEqual(initialState); });
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); });
it('should display list when repos not empty', () => { const repoName = 'testRepo'; store.dispatch(actions.reposLoaded([{ id: 'test', name: repoName }])); expect(component.queryByText(repoName)).toBeInTheDocument(); });
yield put(actions.reposLoaded(repos)); } else { yield put(actions.repoError(RepoErrorType.USER_HAS_NO_REPO));
expect(slice.reducer(state, slice.actions.reposLoaded(repos))).toEqual({ ...slice.initialState, loading: false,
expect(putDescriptor).toEqual(put(slice.actions.reposLoaded(repos))); });