-
-
Notifications
You must be signed in to change notification settings - Fork 134
/
Copy pathCellGroupSpec.tsx
38 lines (28 loc) · 1.37 KB
/
CellGroupSpec.tsx
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
33
34
35
36
37
38
import React from 'react';
import CellGroup from '../src/CellGroup';
import { render, screen } from '@testing-library/react';
import { testStandardProps } from './utils';
describe('CellGroup', () => {
testStandardProps(<CellGroup />);
it('Should render a cell group with default properties', () => {
render(<CellGroup>CellGroup</CellGroup>);
expect(screen.getByText('CellGroup')).to.have.class('rs-cell-group');
expect(screen.getByText('CellGroup').style.transform).to.equal('translate3d(0px, 0px, 0px)');
});
it('Should apply specified width to the cell group', () => {
render(<CellGroup width={100}>CellGroup</CellGroup>);
expect(screen.getByText('CellGroup')).to.have.style('width', '100px');
});
it('Should apply specified height to the cell group', () => {
render(<CellGroup height={100}>CellGroup</CellGroup>);
expect(screen.getByText('CellGroup')).to.have.style('height', '100px');
});
it('Should apply specified left position to the cell group', () => {
render(<CellGroup left={100}>CellGroup</CellGroup>);
expect(screen.getByText('CellGroup').style.transform).to.equal('translate3d(100px, 0px, 0px)');
});
it('Should apply fixed positioning to the cell group', () => {
render(<CellGroup fixed="left">CellGroup</CellGroup>);
expect(screen.getByText('CellGroup')).to.have.class('rs-cell-group-fixed-left');
});
});