8c450790c3
For that the Question.tsx component was refactored to be reusable for categories.
15 lines
662 B
TypeScript
15 lines
662 B
TypeScript
import React from 'react';
|
|
import {render} from '@testing-library/react'
|
|
import AccordionWithEdit from "./AccordionWithEdit";
|
|
|
|
|
|
describe('The Question component', () => {
|
|
test('displays title, category and description', () => {
|
|
const {queryByText} = render(<AccordionWithEdit key={"test"} title={"Test Title"} subTitle={"Test Category"}
|
|
description="Test Description"/>);
|
|
expect(queryByText(/Test Title/)?.textContent).toBe("Test Title");
|
|
expect(queryByText(/Test Category/)?.textContent).toBe("Test Category");
|
|
expect(queryByText(/Test Description/)?.textContent).toBe("Test Description");
|
|
});
|
|
});
|