コード例 #1
0
 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);
 });
コード例 #2
0
ファイル: Grid.spec.js プロジェクト: cjcenizal/ui-framework
      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);
      });
コード例 #3
0
ファイル: Grid.spec.js プロジェクト: cjcenizal/ui-framework
      it('is rendered inside the table element', () => {
        const props = {
          columnsCount: 1,
          children: <tbody />,
        };

        const testCase = TestCaseFactory.createFromElement(<Grid {...props} />);
        expect(testCase.first('tbody')).toBeDefined();
      });
コード例 #4
0
ファイル: Grid.spec.js プロジェクト: cjcenizal/ui-framework
      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);
      });