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

Make onCancelQuery optional #5

Merged
merged 2 commits into from
Dec 5, 2022
Merged

Make onCancelQuery optional #5

merged 2 commits into from
Dec 5, 2022

Conversation

kevinwcyu
Copy link
Collaborator

@kevinwcyu kevinwcyu commented Dec 5, 2022

Fixes: #4

Makes the onCancelQuery prop optional. If it's not passed in, the stop button is not rendered.

With onCancelQuery provided
Screen Shot 2022-12-05 at 8 29 43 AM

With onCancelQuery undefined
Screen Shot 2022-12-05 at 8 31 08 AM

@@ -28,4 +28,12 @@ describe('RunQueryButtons', () => {
const runButton = screen.getByRole('button', { name: 'Run' });
expect(runButton).not.toBeDisabled();
});

it('only renders the `Run button if onCancelQuery is undefined', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably test that the stop button is rendered if onCancelQuery is defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make cancel query optional
2 participants