Skip to content

chore: enhance tests for TemplateSchedulePage #9801

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

Merged
merged 8 commits into from
Sep 21, 2023
Prev Previous commit
Next Next commit
chore: Remove disabled check at the start of the test
  • Loading branch information
Parkreiner committed Sep 20, 2023
commit 507dc80d30a0930e6d71e1e3232e4314d17083cd
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@ const fillAndSubmitForm = async ({
}: FillAndSubmitConfig) => {
const user = userEvent.setup();

const submitButton = screen.getByRole("button", {
name: FooterFormLanguage.defaultSubmitLabel,
});

// This should be removed once we start removing disabled states from the UI;
// not worried about this getting forgotten, because it will trigger an error
// at some point once that migration starts
expect(submitButton).toBeDisabled();

if (default_ttl_ms) {
const defaultTtlField = await screen.findByLabelText(
"Default autostop (hours)",
Expand Down Expand Up @@ -102,6 +93,10 @@ const fillAndSubmitForm = async ({
);
}

const submitButton = screen.getByRole("button", {
name: FooterFormLanguage.defaultSubmitLabel,
});

expect(submitButton).not.toBeDisabled();
await user.click(submitButton);

Expand Down