refactor: handle all admonitions via JSX component (#7152)

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
Alexey Pyltsyn 2022-06-03 15:26:33 +03:00 committed by GitHub
parent 17fe43ecc8
commit 5746c58f41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 709 additions and 250 deletions

View file

@ -87,17 +87,39 @@ describe('validation schemas', () => {
it('admonitionsSchema', () => {
const {testOK, testFail} = createTestHelpers({
schema: AdmonitionsSchema,
defaultValue: {},
defaultValue: true,
});
testOK(undefined);
testOK(true);
testOK(false);
testOK({});
testOK({attr: 'val'});
testOK({tag: '+++'});
testOK({keywords: ['info', 'tip']});
testOK({tag: '+++', keywords: ['info', 'tip']});
testFail(null);
testFail(3);
testFail(true);
testFail([]);
testFail({unknownAttribute: 'val'});
testFail({tag: ''});
testFail({keywords: []});
// Legacy types
testFail({
infima: true,
});
testFail({
icons: 'emoji',
});
testFail({
customTypes: {
myKeyword: {
keyword: `myKeyword`,
infima: true,
svg: '<svg width="512px" height="512px" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"></svg>',
},
},
});
});
it('remarkPluginsSchema', () => {