chore: Add test units for contentRegistry (#1521)
This commit is contained in:
parent
adfa8dd347
commit
0434e7d6b6
22
webapp/src/components/content/contentRegistry.test.tsx
Normal file
22
webapp/src/components/content/contentRegistry.test.tsx
Normal file
|
@ -0,0 +1,22 @@
|
|||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
import '../content/textElement'
|
||||
import '../content/imageElement'
|
||||
import '../content/dividerElement'
|
||||
import '../content/checkboxElement'
|
||||
|
||||
import {contentBlockTypes} from '../../blocks/block'
|
||||
|
||||
import {contentRegistry} from './contentRegistry'
|
||||
|
||||
describe('components/content/ContentRegistry', () => {
|
||||
test('have all contentTypes', () => {
|
||||
expect(contentRegistry.contentTypes).toEqual(contentBlockTypes)
|
||||
})
|
||||
test.each(contentBlockTypes)('have a contentType %s', (content) => {
|
||||
expect(contentRegistry.isContentType(content)).toBeTruthy()
|
||||
})
|
||||
test.each(contentBlockTypes)('get a contentHandler for %s', (content) => {
|
||||
expect(contentRegistry.getHandler(content)).toBeTruthy()
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue
Block a user