Skip to content

Commit

Permalink
Add 1 test triggers a strange error. Moving on anyways
Browse files Browse the repository at this point in the history
  • Loading branch information
campos20 committed Sep 14, 2020
1 parent 73b0d82 commit 3ab0f15
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tnoodle-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --watchAll --watchAll=true",
"test": "react-scripts test --watchAll --watchAll=false",
"eject": "react-scripts eject",
"coveralls": "cat ./coverage/lcov.info | node node_modules/.bin/coveralls"
},
Expand Down
22 changes: 15 additions & 7 deletions tnoodle-ui/src/test/EventPickerTable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@ it("Show editing warn if case of competition selected", async () => {
it("Singular event", async () => {
const store = createStore(Reducer);

jest.spyOn(tnoodleApi, "fetchWcaEvents").mockImplementation(() =>
Promise.resolve(new Response(JSON.stringify(events)))
);

// Choose a competition
const competitionId = competitions[0].id;
store.dispatch(updateCompetitionId(competitionId));
Expand All @@ -114,8 +110,20 @@ it("Singular event", async () => {
);
});

const paragraphs = Array.from(container.querySelectorAll("p"));

// Singular 1 events
expect(paragraphs[0].innerHTML).toContain("event ");
expect(container.querySelector("p").innerHTML).toContain("event ");
});

it("Changes in FMC and MBLD should go to the store", async () => {
const store = createStore(Reducer);

// Render component
await act(async () => {
render(
<Provider store={store}>
<EventPickerTable />
</Provider>,
container
);
});
});

0 comments on commit 3ab0f15

Please sign in to comment.