kopia lustrzana https://github.com/wagtail/wagtail
Use stubs in storybook
rodzic
325587c3d2
commit
b9d61ab82a
|
@ -1,3 +1,4 @@
|
|||
import '../tests/stubs';
|
||||
|
||||
export const parameters = {
|
||||
actions: { argTypesRegex: "^on[A-Z].*" },
|
||||
|
@ -7,4 +8,4 @@ export const parameters = {
|
|||
date: /Date$/,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
const jQueryObj = {
|
||||
on: jest.fn(),
|
||||
off: jest.fn(),
|
||||
};
|
||||
|
||||
global.jQuery = () => jQueryObj;
|
|
@ -99,10 +99,3 @@ global.IMAGE_CHOOSER_MODAL_ONLOAD_HANDLERS = { type: 'image' };
|
|||
global.PAGE_CHOOSER_MODAL_ONLOAD_HANDLERS = { type: 'page' };
|
||||
global.EMBED_CHOOSER_MODAL_ONLOAD_HANDLERS = { type: 'embed' };
|
||||
global.DOCUMENT_CHOOSER_MODAL_ONLOAD_HANDLERS = { type: 'document' };
|
||||
|
||||
const jQueryObj = {
|
||||
on: jest.fn(),
|
||||
off: jest.fn(),
|
||||
};
|
||||
|
||||
global.jQuery = () => jQueryObj;
|
||||
|
|
|
@ -41,7 +41,8 @@
|
|||
"setupFiles": [
|
||||
"./client/tests/adapter.js",
|
||||
"./client/tests/stubs.js",
|
||||
"./client/tests/mock-fetch.js"
|
||||
"./client/tests/mock-fetch.js",
|
||||
"./client/tests/mock-jquery.js"
|
||||
],
|
||||
"snapshotSerializers": [
|
||||
"enzyme-to-json/serializer"
|
||||
|
|
Ładowanie…
Reference in New Issue