Skip to content

Commit

Permalink
chore: [Banner] Update test code
Browse files Browse the repository at this point in the history
  • Loading branch information
meissadia committed Aug 3, 2023
1 parent b95b731 commit 8749080
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/Banner/Banner.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ import { Banner } from './Banner';
import { LanguageLink } from './BannerLanguageLink';

describe('<Banner />', () => {
it('Propagates additional HTML properties to main component element', () => {
const testClass = 'this-is-a-test-classname';
const testTitle = 'test-title';

const testId = 'eyebrow';

render(<Banner className={testClass} title={testTitle} />);
expect(screen.getByTestId(testId)).toBeInTheDocument();
expect(screen.getByTestId(testId)).toHaveClass(testClass);
expect(screen.getByTestId(testId)).toHaveAttribute('title', testTitle);
});

it('renders tagline correctly', () => {
render(
<Banner tagline='An official website of the United States government' />
Expand Down

0 comments on commit 8749080

Please sign in to comment.