Skip to content

Commit 62fe36c

Browse files
committed
chore: add assertion that submit button is not disabled
1 parent 959f5fc commit 62fe36c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

site/src/pages/TemplateSettingsPage/TemplateSchedulePage/TemplateSchedulePage.test.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ const fillAndSubmitForm = async ({
5454
}: FillAndSubmitConfig) => {
5555
const user = userEvent.setup();
5656

57+
const submitButton = screen.getByRole("button", {
58+
name: FooterFormLanguage.defaultSubmitLabel,
59+
});
60+
61+
// This should be removed once we start removing disabled states from the UI;
62+
// not worried about this getting forgotten, because it will trigger an error
63+
// at some point once that migration starts
64+
expect(submitButton).toBeDisabled();
65+
5766
if (default_ttl_ms) {
5867
const defaultTtlField = await screen.findByLabelText(
5968
"Default autostop (hours)",
@@ -93,9 +102,7 @@ const fillAndSubmitForm = async ({
93102
);
94103
}
95104

96-
const submitButton = await screen.findByText(
97-
FooterFormLanguage.defaultSubmitLabel,
98-
);
105+
expect(submitButton).not.toBeDisabled();
99106
await user.click(submitButton);
100107

101108
// User needs to confirm dormancy and auto-deletion fields.

0 commit comments

Comments
 (0)