chore: Add test units for contentRegistry (#1521)

This commit is contained in:
Julien Fabre 2021-10-13 01:03:54 +02:00 committed by GitHub
parent adfa8dd347
commit 0434e7d6b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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()
})
})