mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-24 05:28:01 +02:00
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:
parent
17fe43ecc8
commit
5746c58f41
39 changed files with 709 additions and 250 deletions
|
@ -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', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue