UNPKG

@navinc/base-react-components

Version:
16 lines (14 loc) 665 B
import React from 'react' import { render, fireEvent, screen } from '../tests/with-app-context.js' import { singleArticle } from './data/article.js' import Article from './article.js' describe('<Article />', () => { it('Render the Article and check opening and closing', () => { render(<Article {...singleArticle} />) fireEvent.click(screen.queryByTestId(`article:header:${singleArticle.title}`)) const content = screen.queryByTestId(`article:content:${singleArticle.title}`) expect(content).toBeInTheDocument() fireEvent.click(screen.queryByTestId(`close-article:${singleArticle.title}`)) expect(content).not.toBeInTheDocument() }) })