Skip to content

Instantly share code, notes, and snippets.

@rbinksy
Created March 4, 2020 08:38
Show Gist options
  • Save rbinksy/618b28af0064c883d8df7b463d38b5ee to your computer and use it in GitHub Desktop.
Save rbinksy/618b28af0064c883d8df7b463d38b5ee to your computer and use it in GitHub Desktop.
import React from 'react';
import { Healthbar } from './Healthbar';
import { render } from '@testing-library/react';
test('show current health', () => {
const { getByText } = render(
<Healthbar position="left" playerName="Example Name" health={32} />
);
expect(getByText('32'));
});
test('show current player name', () => {
const { getByText } = render(
<Healthbar position="left" playerName="Example Name" health={32} />
);
expect(getByText('Example Name'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment