Skip to content

Commit

Permalink
test: metrics IMC
Browse files Browse the repository at this point in the history
Natyrodrigues committed Sep 18, 2024
1 parent cd76e12 commit 7721b84
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
@@ -70,6 +70,13 @@ describe('CardMetrica Component', () => {
// outras propriedades que o item pode ter
};

const mockItemIMC: IMetrica = {
id: 1,
idIdoso: 123,
categoria: EMetricas.IMC,
// 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} />);

@@ -142,6 +149,15 @@ describe('CardMetrica Component', () => {
});
});

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

await waitFor(() => {
expect(getByText('80')).toBeTruthy(); // Verifica se o valor da temperatura é exibido
expect(getByText('kg/m²')).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({

0 comments on commit 7721b84

Please sign in to comment.