From cd7bac88feba09458eed3ccc139e73dc57b963d9 Mon Sep 17 00:00:00 2001 From: Gustavo Rodrigo Gularte Arend Date: Mon, 16 Sep 2024 16:41:04 -0300 Subject: [PATCH] refactor: ajustes nos parametros e testes removidos --- src/components/TextInput/index.spec.js | 4 ++-- src/components/UploadImage/index.spec.js | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/components/TextInput/index.spec.js b/src/components/TextInput/index.spec.js index b6214880..833fd768 100644 --- a/src/components/TextInput/index.spec.js +++ b/src/components/TextInput/index.spec.js @@ -17,7 +17,7 @@ const renderTextInput = (parameters) => render(new TextInput(parameters)); describe('TextInput', () => { it('renders with props', () => { renderTextInput(propsMock); - const textInput = screen.getByPlaceholderText('Write something'); + const textInput = screen.getByPlaceholderText(propsMock.placeholder); expect(textInput).toBeInTheDocument(); }); @@ -76,6 +76,6 @@ describe('TextInput', () => { expect(element).toBeDisabled(); textInput.enable(); - expect(element).toBeEnabled(false); + expect(element).toBeEnabled(); }); }); diff --git a/src/components/UploadImage/index.spec.js b/src/components/UploadImage/index.spec.js index 498750c2..94655fa3 100644 --- a/src/components/UploadImage/index.spec.js +++ b/src/components/UploadImage/index.spec.js @@ -10,12 +10,8 @@ describe('UploadImage', () => { it('renders correctly', () => { renderUploadImage(); const uploadInput = screen.getByLabelText('Carregar imagem'); - const buttonIcon = screen.getByAltText('Botão com ícone'); - const imagePreview = screen.getByLabelText('Carregar imagem'); expect(uploadInput).toBeInTheDocument(); - expect(buttonIcon).toBeInTheDocument(); - expect(imagePreview).toBeInTheDocument(); }); describe('Upload input', () => { @@ -29,7 +25,6 @@ describe('UploadImage', () => { await user.upload(uploadInput, file); expect(uploadInput.files[0]).toBe(file); - expect(uploadInput.files.item(0)).toBe(file); }); });