mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-31 07:18:59 +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
|
@ -63,7 +63,7 @@ describe('normalizeDocsPluginOptions', () => {
|
|||
breadcrumbs: true,
|
||||
showLastUpdateTime: true,
|
||||
showLastUpdateAuthor: true,
|
||||
admonitions: {},
|
||||
admonitions: false,
|
||||
includeCurrentVersion: false,
|
||||
disableVersioning: true,
|
||||
editCurrentVersion: true,
|
||||
|
@ -84,7 +84,6 @@ describe('normalizeDocsPluginOptions', () => {
|
|||
expect(testValidate(userOptions)).toEqual({
|
||||
...defaultOptions,
|
||||
...userOptions,
|
||||
remarkPlugins: [...userOptions.remarkPlugins!, expect.any(Array)],
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -102,7 +101,6 @@ describe('normalizeDocsPluginOptions', () => {
|
|||
expect(testValidate(userOptions)).toEqual({
|
||||
...defaultOptions,
|
||||
...userOptions,
|
||||
remarkPlugins: [...userOptions.remarkPlugins!, expect.any(Array)],
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -116,14 +114,14 @@ describe('normalizeDocsPluginOptions', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('rejects admonitions true', () => {
|
||||
const admonitionsTrue: Options = {
|
||||
admonitions: true,
|
||||
};
|
||||
it('rejects admonitions array', () => {
|
||||
expect(() =>
|
||||
testValidate(admonitionsTrue),
|
||||
testValidate({
|
||||
// @ts-expect-error: rejected value
|
||||
admonitions: [],
|
||||
}),
|
||||
).toThrowErrorMatchingInlineSnapshot(
|
||||
`""admonitions" contains an invalid value"`,
|
||||
`""admonitions" does not look like a valid admonitions config"`,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue