Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logbook clocking #103

Merged
merged 13 commits into from
Nov 14, 2019
Prev Previous commit
Next Next commit
Add integration test for using clock in/out button
  • Loading branch information
jamesnvc committed Nov 13, 2019
commit 6a6f52f6baf51f7b9aff162ed297acd8534ad284
29 changes: 29 additions & 0 deletions src/components/OrgFile/OrgFile.integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,35 @@ Some description content
expect(queryByText('TODO')).toBeFalsy();
expect(queryByText('DONE')).toBeTruthy();
});

test('Can clock in & out of an event', () => {
const { getByText, queryByText } = render(
<MemoryRouter keyLength={0}>
<Provider store={store}>
<OrgFile path="fixtureTestFile.org" />
</Provider>
</MemoryRouter>
);

expect(queryByText('Clock In')).toBeFalsy();
expect(queryByText('Clock Out')).toBeFalsy();

fireEvent.click(getByText('Top level header'));

expect(queryByText('Clock In')).toBeTruthy();
expect(queryByText('Clock Out')).toBeFalsy();

fireEvent.click(getByText('Clock In'));

expect(queryByText('Clock In')).toBeFalsy();
expect(queryByText('Clock Out')).toBeTruthy();

fireEvent.click(getByText('Clock Out'));

expect(queryByText('Clock In')).toBeTruthy();
expect(queryByText('Clock Out')).toBeFalsy();

});
});

describe('Renders everything starting from an Org file', () => {
Expand Down