chore: do not print prototype in jest snapshot (#6908)

This commit is contained in:
Joshua Chen 2022-03-13 19:34:50 +08:00 committed by GitHub
parent 3a4b9b4c30
commit 8c1e518ba2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 1536 additions and 1519 deletions

View file

@ -1,54 +1,54 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`DefaultSidebarItemsGenerator generates complex nested sidebar 1`] = `
Array [
Object {
[
{
"id": "intro",
"type": "doc",
},
Object {
{
"collapsed": undefined,
"collapsible": undefined,
"items": Array [
Object {
"items": [
{
"id": "tutorial1",
"type": "doc",
},
Object {
{
"id": "tutorial2",
"type": "doc",
},
],
"label": "Tutorials",
"link": Object {
"link": {
"id": "tutorials-index",
"type": "doc",
},
"type": "category",
},
Object {
{
"collapsed": false,
"collapsible": undefined,
"customProps": Object {
"customProps": {
"description": "foo",
},
"items": Array [
Object {
"items": [
{
"className": "foo",
"id": "guide1",
"type": "doc",
},
Object {
{
"collapsed": undefined,
"collapsible": undefined,
"items": Array [
Object {
"items": [
{
"id": "nested-guide",
"type": "doc",
},
],
"label": "SubGuides (metadata file label)",
"link": Object {
"link": {
"description": "subGuides-description",
"slug": "subGuides-generated-index-slug",
"title": "subGuides-title",
@ -56,19 +56,19 @@ Array [
},
"type": "category",
},
Object {
{
"id": "guide2",
"type": "doc",
},
],
"label": "Guides",
"link": Object {
"link": {
"id": "guides-index",
"type": "doc",
},
"type": "category",
},
Object {
{
"id": "end",
"type": "doc",
},
@ -76,25 +76,25 @@ Array [
`;
exports[`DefaultSidebarItemsGenerator generates simple flat sidebar 1`] = `
Array [
Object {
[
{
"id": "doc3",
"type": "doc",
},
Object {
{
"id": "doc4",
"type": "doc",
},
Object {
{
"id": "doc1",
"label": "doc1 sidebar label",
"type": "doc",
},
Object {
{
"id": "doc2",
"type": "doc",
},
Object {
{
"id": "doc5",
"type": "doc",
},
@ -102,33 +102,33 @@ Array [
`;
exports[`DefaultSidebarItemsGenerator generates subfolder sidebar 1`] = `
Array [
Object {
[
{
"collapsed": undefined,
"collapsible": undefined,
"items": Array [
Object {
"items": [
{
"id": "doc8",
"type": "doc",
},
Object {
{
"id": "doc7",
"type": "doc",
},
],
"label": "subsubsubfolder3 (_category_.json label)",
"link": Object {
"link": {
"id": "doc1",
"type": "doc",
},
"type": "category",
},
Object {
{
"className": "bar",
"collapsed": undefined,
"collapsible": undefined,
"items": Array [
Object {
"items": [
{
"id": "doc6",
"type": "doc",
},
@ -136,19 +136,19 @@ Array [
"label": "subsubsubfolder2 (_category_.yml label)",
"type": "category",
},
Object {
{
"id": "doc1",
"type": "doc",
},
Object {
{
"id": "doc4",
"type": "doc",
},
Object {
{
"collapsed": undefined,
"collapsible": undefined,
"items": Array [
Object {
"items": [
{
"id": "doc5",
"type": "doc",
},
@ -160,45 +160,45 @@ Array [
`;
exports[`DefaultSidebarItemsGenerator respects custom isCategoryIndex 1`] = `
Array [
Object {
[
{
"id": "intro",
"type": "doc",
},
Object {
{
"collapsed": undefined,
"collapsible": undefined,
"items": Array [
Object {
"items": [
{
"id": "tutorial1",
"type": "doc",
},
Object {
{
"id": "tutorial2",
"type": "doc",
},
],
"label": "Tutorials",
"link": Object {
"link": {
"id": "tutorials-index",
"type": "doc",
},
"type": "category",
},
Object {
{
"collapsed": undefined,
"collapsible": undefined,
"items": Array [
Object {
"items": [
{
"className": "foo",
"id": "guide1",
"type": "doc",
},
Object {
{
"id": "guide2",
"type": "doc",
},
Object {
{
"id": "not-guides-index",
"type": "doc",
},
@ -210,40 +210,40 @@ Array [
`;
exports[`DefaultSidebarItemsGenerator uses explicit link over the index/readme.{md,mdx} naming convention 1`] = `
Array [
Object {
[
{
"collapsed": undefined,
"collapsible": undefined,
"items": Array [
Object {
"items": [
{
"id": "parent/doc2",
"type": "doc",
},
Object {
{
"id": "parent/doc1",
"type": "doc",
},
],
"label": "Category label",
"link": Object {
"link": {
"id": "parent/doc3",
"type": "doc",
},
"type": "category",
},
Object {
{
"collapsed": undefined,
"collapsible": undefined,
"items": Array [
Object {
"items": [
{
"id": "parent/doc4",
"type": "doc",
},
Object {
{
"id": "parent/doc6",
"type": "doc",
},
Object {
{
"id": "parent/doc5",
"type": "doc",
},

View file

@ -1,13 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`loadSidebars sidebars link 1`] = `
Object {
"docs": Array [
Object {
{
"docs": [
{
"collapsed": true,
"collapsible": true,
"items": Array [
Object {
"items": [
{
"href": "https://github.com",
"label": "category",
"type": "link",
@ -22,17 +22,17 @@ Object {
`;
exports[`loadSidebars sidebars with category.collapsed property 1`] = `
Object {
"docs": Array [
Object {
{
"docs": [
{
"collapsed": true,
"collapsible": true,
"items": Array [
Object {
"items": [
{
"collapsed": false,
"collapsible": true,
"items": Array [
Object {
"items": [
{
"id": "doc1",
"type": "doc",
},
@ -46,15 +46,15 @@ Object {
"link": undefined,
"type": "category",
},
Object {
{
"collapsed": true,
"collapsible": true,
"items": Array [
Object {
"items": [
{
"collapsed": false,
"collapsible": true,
"items": Array [
Object {
"items": [
{
"id": "doc2",
"type": "doc",
},
@ -73,13 +73,13 @@ Object {
`;
exports[`loadSidebars sidebars with category.collapsed property at first level 1`] = `
Object {
"docs": Array [
Object {
{
"docs": [
{
"collapsed": false,
"collapsible": true,
"items": Array [
Object {
"items": [
{
"id": "doc1",
"type": "doc",
},
@ -88,11 +88,11 @@ Object {
"link": undefined,
"type": "category",
},
Object {
{
"collapsed": false,
"collapsible": true,
"items": Array [
Object {
"items": [
{
"id": "doc2",
"type": "doc",
},
@ -106,41 +106,41 @@ Object {
`;
exports[`loadSidebars sidebars with deep level of category 1`] = `
Object {
"docs": Array [
Object {
{
"docs": [
{
"collapsed": true,
"collapsible": true,
"items": Array [
Object {
"items": [
{
"id": "a",
"type": "doc",
},
Object {
{
"collapsed": true,
"collapsible": true,
"items": Array [
Object {
"items": [
{
"collapsed": true,
"collapsible": true,
"items": Array [
Object {
"items": [
{
"id": "c",
"type": "doc",
},
Object {
{
"collapsed": true,
"collapsible": true,
"items": Array [
Object {
"items": [
{
"id": "d",
"type": "doc",
},
Object {
{
"collapsed": true,
"collapsible": true,
"items": Array [
Object {
"items": [
{
"id": "e",
"type": "doc",
},
@ -159,7 +159,7 @@ Object {
"link": undefined,
"type": "category",
},
Object {
{
"id": "f",
"type": "doc",
},
@ -178,13 +178,13 @@ Object {
`;
exports[`loadSidebars sidebars with first level not a category 1`] = `
Object {
"docs": Array [
Object {
{
"docs": [
{
"collapsed": true,
"collapsible": true,
"items": Array [
Object {
"items": [
{
"id": "greeting",
"type": "doc",
},
@ -193,7 +193,7 @@ Object {
"link": undefined,
"type": "category",
},
Object {
{
"id": "api",
"type": "doc",
},
@ -202,26 +202,26 @@ Object {
`;
exports[`loadSidebars sidebars with known sidebar item type 1`] = `
Object {
"docs": Array [
Object {
{
"docs": [
{
"collapsed": true,
"collapsible": true,
"items": Array [
Object {
"items": [
{
"id": "foo/bar",
"type": "doc",
},
Object {
{
"id": "foo/baz",
"type": "doc",
},
Object {
{
"href": "https://github.com",
"label": "Github",
"type": "link",
},
Object {
{
"id": "hello",
"type": "ref",
},
@ -230,11 +230,11 @@ Object {
"link": undefined,
"type": "category",
},
Object {
{
"collapsed": true,
"collapsible": true,
"items": Array [
Object {
"items": [
{
"id": "hello",
"type": "doc",
},
@ -248,13 +248,13 @@ Object {
`;
exports[`loadSidebars undefined path 1`] = `
Object {
"defaultSidebar": Array [
Object {
{
"defaultSidebar": [
{
"collapsed": true,
"collapsible": true,
"items": Array [
Object {
"items": [
{
"id": "bar",
"type": "doc",
},

View file

@ -1,15 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`normalization normalizes shorthands 1`] = `
Object {
"sidebar": Array [
Object {
"items": Array [
Object {
{
"sidebar": [
{
"items": [
{
"id": "doc1",
"type": "doc",
},
Object {
{
"id": "doc2",
"type": "doc",
},
@ -17,15 +17,15 @@ Object {
"label": "Category",
"type": "category",
},
Object {
"items": Array [
Object {
"items": Array [
Object {
{
"items": [
{
"items": [
{
"id": "doc3",
"type": "doc",
},
Object {
{
"id": "doc4",
"type": "doc",
},
@ -33,13 +33,13 @@ Object {
"label": "Subcategory 1",
"type": "category",
},
Object {
"items": Array [
Object {
{
"items": [
{
"id": "doc5",
"type": "doc",
},
Object {
{
"id": "doc6",
"type": "doc",
},
@ -56,20 +56,20 @@ Object {
`;
exports[`normalization normalizes shorthands 2`] = `
Object {
"sidebar": Array [
Object {
{
"sidebar": [
{
"href": "https://google.com",
"label": "Google",
"type": "link",
},
Object {
"items": Array [
Object {
{
"items": [
{
"id": "doc1",
"type": "doc",
},
Object {
{
"id": "doc2",
"type": "doc",
},
@ -77,13 +77,13 @@ Object {
"label": "Category 1",
"type": "category",
},
Object {
"items": Array [
Object {
{
"items": [
{
"id": "doc3",
"type": "doc",
},
Object {
{
"id": "doc4",
"type": "doc",
},

View file

@ -1,13 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`postProcess corrects collapsed state inconsistencies 1`] = `
Object {
"sidebar": Array [
Object {
{
"sidebar": [
{
"collapsed": false,
"collapsible": false,
"items": Array [
Object {
"items": [
{
"id": "foo",
"type": "doc",
},
@ -21,13 +21,13 @@ Object {
`;
exports[`postProcess corrects collapsed state inconsistencies 2`] = `
Object {
"sidebar": Array [
Object {
{
"sidebar": [
{
"collapsed": false,
"collapsible": false,
"items": Array [
Object {
"items": [
{
"id": "foo",
"type": "doc",
},
@ -41,13 +41,13 @@ Object {
`;
exports[`postProcess corrects collapsed state inconsistencies 3`] = `
Object {
"sidebar": Array [
Object {
{
"sidebar": [
{
"collapsed": false,
"collapsible": false,
"items": Array [
Object {
"items": [
{
"id": "foo",
"type": "doc",
},
@ -61,14 +61,14 @@ Object {
`;
exports[`postProcess transforms category without subitems 1`] = `
Object {
"sidebar": Array [
Object {
{
"sidebar": [
{
"href": "version/generated/permalink",
"label": "Category",
"type": "link",
},
Object {
{
"id": "doc ID",
"label": "Category 2",
"type": "doc",