test: Add test to check hostname length
This adds a test to check the length of the hostname.
This commit is contained in:
parent
dc24ba24e4
commit
3bd4dc89c4
2 changed files with 25 additions and 10 deletions
|
|
@ -44,7 +44,7 @@ const goToReviewStep = async () => {
|
|||
};
|
||||
|
||||
const enterHostname = async (hostname: string) => {
|
||||
const user = userEvent.setup();
|
||||
const user = userEvent.setup({ delay: null });
|
||||
const hostnameInput = await screen.findByPlaceholderText(/Add a hostname/i);
|
||||
await waitFor(() => user.type(hostnameInput, hostname));
|
||||
};
|
||||
|
|
@ -113,6 +113,21 @@ describe('Step Hostname', () => {
|
|||
expect(screen.queryByText(/Invalid hostname/)).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('hostname is invalid for more than 64 chars', async () => {
|
||||
await renderCreateMode();
|
||||
await goToHostnameStep();
|
||||
const nextButton = await getNextButton();
|
||||
|
||||
// enter invalid hostname
|
||||
const invalidHostname = 'a'.repeat(65);
|
||||
await enterHostname(invalidHostname);
|
||||
expect(nextButton).toBeDisabled();
|
||||
|
||||
// enter valid hostname
|
||||
await clearHostname();
|
||||
expect(nextButton).toBeEnabled();
|
||||
});
|
||||
|
||||
test('revisit step button on Review works', async () => {
|
||||
await renderCreateMode();
|
||||
await goToHostnameStep();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue