1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-20 13:59:40 +02:00

feat(ui): write tests [EE-6685] (#11081)

This commit is contained in:
Chaim Lev-Ari 2024-02-14 17:25:37 +02:00 committed by GitHub
parent 2d25bf4afa
commit 4bf18b1d65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 232 additions and 15 deletions

View file

@ -29,15 +29,15 @@ test('submit button should be disabled when name or image is missing', async ()
expect(button).toBeDisabled();
const nameInput = getByLabelText(/name/i);
userEvent.type(nameInput, 'name');
await userEvent.type(nameInput, 'name');
const imageInput = getByLabelText(/image/i);
userEvent.type(imageInput, 'image');
await userEvent.type(imageInput, 'image');
await expect(findByText(/Deploy the container/)).resolves.toBeEnabled();
expect(nameInput).toHaveValue('name');
userEvent.clear(nameInput);
await userEvent.clear(nameInput);
await expect(findByText(/Deploy the container/)).resolves.toBeDisabled();
});