Skip to content

Commit

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

const mockItemHidratacao: IMetrica = {
id: 1,
idIdoso: 123,
categoria: EMetricas.HIDRATACAO,
// 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 @@ -158,6 +165,15 @@ describe('CardMetrica Component', () => {
});
});

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

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

Please sign in to comment.