diff --git a/src/dom_components/model/ComponentTableHead.js b/src/dom_components/model/ComponentTableHead.js index f1f82626f..070479da6 100644 --- a/src/dom_components/model/ComponentTableHead.js +++ b/src/dom_components/model/ComponentTableHead.js @@ -1,22 +1,17 @@ import ComponentTableBody from './ComponentTableBody'; +import { toLowerCase } from 'utils/mixins'; + +const type = 'thead'; export default ComponentTableBody.extend( { defaults: { ...ComponentTableBody.prototype.defaults, - type: 'thead', - tagName: 'thead' + type, + tagName: type } }, { - isComponent(el) { - let result = ''; - - if (el.tagName == 'THEAD') { - result = { type: 'thead' }; - } - - return result; - } + isComponent: el => toLowerCase(el.tagName) === type } ); diff --git a/test/specs/dom_components/model/ComponentTypes.js b/test/specs/dom_components/model/ComponentTypes.js index 98e522f91..889e8d123 100644 --- a/test/specs/dom_components/model/ComponentTypes.js +++ b/test/specs/dom_components/model/ComponentTypes.js @@ -44,6 +44,10 @@ describe('Component Types', () => { expectedType('
', 'table', { skipHtml: 1 }); }); + test(' is correctly recognized', () => { + expectedType('', 'thead', { skipHtml: 1 }); + }); + test(' is correctly recognized', () => { expectedType('', 'tbody', { skipHtml: 1 }); });