|
|
|
@ -6,7 +6,7 @@ describe('Component Types', () => { |
|
|
|
|
|
|
|
const expectedType = (input, type, opts = {}) => { |
|
|
|
const cmp = wrapper.append(input)[0]; |
|
|
|
expect(wrapper.components().length).toBe(1); |
|
|
|
expect(wrapper.components().length).toBe(opts.total || 1); |
|
|
|
!opts.skipHtml && expect(cmp.toHTML()).toBe(input); |
|
|
|
expect(cmp.is(type)).toBe(true); |
|
|
|
}; |
|
|
|
@ -48,6 +48,11 @@ describe('Component Types', () => { |
|
|
|
expectedType('<tbody></tbody>', 'tbody', { skipHtml: 1 }); |
|
|
|
}); |
|
|
|
|
|
|
|
test('<td> & <th> are correctly recognized', () => { |
|
|
|
expectedType('<td></td>', 'cell'); |
|
|
|
expectedType('<th></th>', 'cell', { total: 2 }); |
|
|
|
}); |
|
|
|
|
|
|
|
test('<script> is correctly recognized', () => { |
|
|
|
// const scr = 'console.log("Inline script");'; // issues with jsdom parser
|
|
|
|
const scr = ``; |
|
|
|
|