fix demos

This commit is contained in:
Dylan Vorster
2021-03-13 12:30:49 +02:00
parent 4f3df60758
commit 6adff81ae7
9 changed files with 23 additions and 11 deletions

View File

@ -1,3 +1,10 @@
import { Toolkit } from "@projectstorm/react-canvas-core";
Toolkit.TESTING = true;
export default {
title: 'Simple Usage'
};
import demo_simple from "./demo-simple"; import demo_simple from "./demo-simple";
import demo_flow from "./demo-simple-flow"; import demo_flow from "./demo-simple-flow";
import demo_performance from "./demo-performance"; import demo_performance from "./demo-performance";
@ -10,10 +17,6 @@ import demo_canvas_drag from "./demo-canvas-drag";
import demo_dynamic_ports from "./demo-dynamic-ports"; import demo_dynamic_ports from "./demo-dynamic-ports";
import demo_labels from "./demo-labelled-links"; import demo_labels from "./demo-labelled-links";
export default {
title: 'Simple Usage'
};
export const DemoSimple = demo_simple; export const DemoSimple = demo_simple;
export const SimpleFlowExample = demo_flow; export const SimpleFlowExample = demo_flow;
export const PerformanceDemo = demo_performance export const PerformanceDemo = demo_performance

View File

@ -1,3 +1,6 @@
import { Toolkit } from "@projectstorm/react-canvas-core";
Toolkit.TESTING = true;
export default { export default {
title: 'Advanced Usage' title: 'Advanced Usage'
}; };

View File

@ -1,3 +1,6 @@
import { Toolkit } from "@projectstorm/react-canvas-core";
Toolkit.TESTING = true;
export default { export default {
title: 'Customization' title: 'Customization'
}; };

View File

@ -1,3 +1,6 @@
import { Toolkit } from "@projectstorm/react-canvas-core";
Toolkit.TESTING = true;
export default { export default {
title: 'External Libs' title: 'External Libs'
}; };

View File

@ -1,4 +1,4 @@
import { ElementHandle, FrameBase } from 'puppeteer'; import { ElementHandle } from 'puppeteer';
export abstract class E2EBase { export abstract class E2EBase {
name: string; name: string;
@ -7,8 +7,8 @@ export abstract class E2EBase {
this.name = name; this.name = name;
} }
async getSelector(): Promise<FrameBase> { async getSelector(): Promise<any> {
return page as FrameBase; return page;
} }
async getElement(): Promise<ElementHandle> { async getElement(): Promise<ElementHandle> {

View File

@ -1,5 +1,4 @@
import * as _ from 'lodash'; import * as _ from 'lodash';
import { FrameBase } from 'puppeteer';
import { E2EBase } from './E2EBase'; import { E2EBase } from './E2EBase';
import { E2ENode } from './E2ENode'; import { E2ENode } from './E2ENode';
import { E2ELink } from './E2ELink'; import { E2ELink } from './E2ELink';
@ -73,7 +72,7 @@ export class E2EPort extends E2EBase {
return new E2ELink(link); return new E2ELink(link);
} }
async getSelector(): Promise<FrameBase> { async getSelector(): Promise<any> {
return (await this.parent.getElement()) as any; return (await this.parent.getElement()) as any;
} }

View File

@ -4,7 +4,7 @@ import { E2ENode } from './helpers/E2ENode';
describe('simple test', () => { describe('simple test', () => {
beforeAll(async () => { beforeAll(async () => {
await page.goto(`file://${__dirname}/../.out/iframe.html?path=/story/simple-usage--simple-example`); await page.goto(`file://${__dirname}/../.out/iframe.html?path=/story/simple-usage--demo-simple`);
}); });
it('should delete a link and create a new one', async () => { it('should delete a link and create a new one', async () => {

View File

@ -31,6 +31,7 @@
"publish:prod": "yarn build:prod && lerna publish --force-publish", "publish:prod": "yarn build:prod && lerna publish --force-publish",
"publish:storybook": "cd packages/diagrams-demo-gallery && yarn storybook:build && ../../node_modules/.bin/storybook-to-ghpages --existing-output-dir .out", "publish:storybook": "cd packages/diagrams-demo-gallery && yarn storybook:build && ../../node_modules/.bin/storybook-to-ghpages --existing-output-dir .out",
"test:ci": "lerna run test --stream -- --runInBand --ci ", "test:ci": "lerna run test --stream -- --runInBand --ci ",
"test": "lerna run test --stream",
"pretty": "prettier --write \"packages/**/*.{ts,tsx,scss,js,jsx}\"" "pretty": "prettier --write \"packages/**/*.{ts,tsx,scss,js,jsx}\""
}, },
"peerDependencies": { "peerDependencies": {

View File

@ -12,7 +12,7 @@
"build": "../../node_modules/.bin/webpack", "build": "../../node_modules/.bin/webpack",
"build:es": "../../node_modules/.bin/tsc", "build:es": "../../node_modules/.bin/tsc",
"build:prod": "NODE_ENV=production ../../node_modules/.bin/webpack && NODE_ENV=production ../../node_modules/.bin/tsc", "build:prod": "NODE_ENV=production ../../node_modules/.bin/webpack && NODE_ENV=production ../../node_modules/.bin/tsc",
"test": "../../node_modules/.bin/jest --no-cache" "test": "../../node_modules/.bin/jest"
}, },
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"