mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-11 07:55:47 +01:00
fixed storyshots with react-diff-view
This commit is contained in:
@@ -1,6 +1,22 @@
|
||||
import path from "path";
|
||||
import initStoryshots from "@storybook/addon-storyshots";
|
||||
import initStoryshots, { snapshotWithOptions } from "@storybook/addon-storyshots";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const createNodeMock = (element: any) => {
|
||||
if (element.type === "tr") {
|
||||
return {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
querySelector: (selector: string) => {}
|
||||
};
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
initStoryshots({
|
||||
configPath: path.resolve(__dirname, "..", ".storybook")
|
||||
configPath: path.resolve(__dirname, "..", ".storybook"),
|
||||
// fix snapshot tests with react-diff-view which uses a ref on tr
|
||||
// @see https://github.com/storybookjs/storybook/pull/1090
|
||||
test: snapshotWithOptions({
|
||||
createNodeMock
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user