-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoverview.ProductInfoBottom.test.js
32 lines (29 loc) · 1.22 KB
/
overview.ProductInfoBottom.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/**
* @jest-environment jsdom
*/
import React from 'react';
import {render} from '@testing-library/react';
import '@testing-library/jest-dom';
import { unmountComponentAtNode } from 'react-dom';
import ProductInfoBottom from '../client/src/components/Overview/ProductInfoBottom.jsx';
it('should render the slogan, description and feature list in ProductInfoBottom', () => {
let slogan = 'slogan';
let description = 'description';
let featureList = [
{ feature: 'feature1',
value: 'is working' },
{ feature: 'feature2',
value: 'is also working' }
];
const {container, getByText} = render(<ProductInfoBottom slogan={slogan} description={description} features={featureList} />);
expect(getByText('slogan')).toBeInTheDocument();
expect(getByText('description')).toBeInTheDocument();
expect(getByText('is working')).toBeInTheDocument();
expect(getByText('is also working')).toBeInTheDocument();
});
it('should render without any features if there are no features', () => {
let slogan = 'slogan';
let description = 'description';
const {container, queryByText} = render(<ProductInfoBottom slogan={slogan} description={description} features={null} />);
expect(queryByText('is working')).toBeNull();
});