Skip to content

Commit

Permalink
test: metric ALTURA
Browse files Browse the repository at this point in the history
  • Loading branch information
Natyrodrigues committed Sep 18, 2024
1 parent 6468632 commit cd76e12
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/app/__tests__/cardMetrica.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ describe('CardMetrica Component', () => {
// outras propriedades que o item pode ter
};

const mockItemAltura: IMetrica = {
id: 1,
idIdoso: 123,
categoria: EMetricas.ALTURA,
// outras propriedades que o item pode ter
};

it('renderiza corretamente com um valor de métrica FREQ_CARDIACA', async () => {
const { getByText } = render(<CardMetrica item={mockItemFrequencia} />);

Expand Down Expand Up @@ -126,6 +133,15 @@ describe('CardMetrica Component', () => {
});
});

it('renderiza corretamente com um valor de métrica ALTURA', async () => {
const { getByText } = render(<CardMetrica item={mockItemAltura} />);

await waitFor(() => {
expect(getByText('80')).toBeTruthy(); // Verifica se o valor da temperatura é exibido
expect(getByText('cm')).toBeTruthy(); // Verifica se a unidade de medida está correta
});
});

it('renderiza corretamente quando não há valor de métrica', async () => {
// Simular o retorno vazio para não ter valores de métrica
(database.get as jest.Mock).mockReturnValueOnce({
Expand Down

0 comments on commit cd76e12

Please sign in to comment.