fix: media popup (#225)
This commit is contained in:
committed by
GitHub
parent
c1ae2a1bcc
commit
6602f37495
54
core/test/data/collection.tsx
Normal file
54
core/test/data/collection.tsx
Normal file
@ -0,0 +1,54 @@
|
||||
import type { Collection, MarkdownField } from '@staticcms/core';
|
||||
|
||||
export const mockMarkdownField: MarkdownField = {
|
||||
label: 'Body',
|
||||
name: 'body',
|
||||
widget: 'markdown',
|
||||
hint: 'Main content goes here.',
|
||||
};
|
||||
|
||||
export const mockMarkdownCollection: Collection<MarkdownField> = {
|
||||
name: 'posts',
|
||||
label: 'Posts',
|
||||
label_singular: 'Post',
|
||||
description:
|
||||
'The description is a great place for tone setting, high level information, and editing guidelines that are specific to a collection.\n',
|
||||
folder: '_posts',
|
||||
slug: '{{year}}-{{month}}-{{day}}-{{slug}}',
|
||||
summary: '{{title}} -- {{year}}/{{month}}/{{day}}',
|
||||
sortable_fields: {
|
||||
fields: ['title', 'date'],
|
||||
default: {
|
||||
field: 'title',
|
||||
},
|
||||
},
|
||||
create: true,
|
||||
fields: [
|
||||
{
|
||||
label: 'Title',
|
||||
name: 'title',
|
||||
widget: 'string',
|
||||
},
|
||||
{
|
||||
label: 'Draft',
|
||||
name: 'draft',
|
||||
widget: 'boolean',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
label: 'Publish Date',
|
||||
name: 'date',
|
||||
widget: 'datetime',
|
||||
date_format: 'yyyy-MM-dd',
|
||||
time_format: 'HH:mm',
|
||||
format: "yyyy-MM-dd'T'HH:mm:ss.SSSXXX",
|
||||
},
|
||||
{
|
||||
label: 'Cover Image',
|
||||
name: 'image',
|
||||
widget: 'image',
|
||||
required: false,
|
||||
},
|
||||
mockMarkdownField,
|
||||
],
|
||||
};
|
@ -1,6 +1,3 @@
|
||||
global.TextEncoder = TextEncoder;
|
||||
global.TextDecoder = TextDecoder;
|
||||
|
||||
if (typeof window === 'undefined') {
|
||||
global.window = {
|
||||
URL: {
|
||||
@ -15,3 +12,5 @@ if (typeof window === 'undefined') {
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
global.URL.createObjectURL = jest.fn();
|
||||
|
Reference in New Issue
Block a user