it(`is added to ${elementName}`, () => { const extendedProps = Object.assign({}, props, { dataId: 'dataId', }); const testCase = TestCaseFactory.create(Component, extendedProps); const element = selector ? testCase.first(selector) : testCase.dom; expect(element.getAttribute('data-id')).toBe(extendedProps.dataId); });
it('is applied as a class of the table element', () => { const props = { columnsCount: 1, classTable: 'test', }; const testCase = TestCaseFactory.createFromElement(<Grid {...props} />); expect(testCase.first('table').className).toContain(props.classTable); });
it('is rendered inside the table element', () => { const props = { columnsCount: 1, children: <tbody />, }; const testCase = TestCaseFactory.createFromElement(<Grid {...props} />); expect(testCase.first('tbody')).toBeDefined(); });
it('is applied as a class of the root element', () => { const props = { columnsCount: 1, classContainer: 'test', }; const testCase = TestCaseFactory.createFromElement(<Grid {...props} />); expect(testCase.dom.getAttribute('class') .indexOf(props.classContainer) !== -1).toBe(true); });