Skip to content

Commit

Permalink
feat: jest snapshots rtl, enzyme and rtr
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Aug 27, 2020
1 parent 19f712c commit 02a3e0d
Show file tree
Hide file tree
Showing 92 changed files with 30,647 additions and 976 deletions.
4 changes: 2 additions & 2 deletions core/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
"@types/faker": "^4.1.9",
"@types/glob": "^7.1.3",
"@types/glob-base": "^0.3.0",
"@types/jest": "^25.1.2",
"@types/jest": "^26.0.10",
"@types/micromatch": "^4.0.1",
"cross-env": "^5.2.1",
"eslint": "^6.5.1",
"jest": "^24.9.0"
"jest": "^26.4.2"
},
"browser": {
"fs": false
Expand Down
5 changes: 2 additions & 3 deletions core/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
},
"license": "MIT",
"dependencies": {
"@component-controls/components": "^1.21.0",
"@storybook/csf": "^0.0.1",
"deepmerge": "^4.2.2",
"escape-html": "^1.0.3",
Expand All @@ -41,10 +40,10 @@
"devDependencies": {
"@component-controls/ts-markdown-docs": "^1.21.0",
"@types/faker": "^4.1.9",
"@types/jest": "^25.1.2",
"@types/jest": "^26.0.10",
"cross-env": "^5.2.1",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"jest": "^26.4.2",
"webpack": "^4.43.0"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion core/core/src/configuration.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Configuration as WebpackConfiguration } from 'webpack';
import { ActionItems } from '@component-controls/components';
import { ActionItems } from './utility';
import { ComponentType, ReactNode } from 'react';
import { StoryRenderFn } from './utility';
import { ReactElement } from 'react';
Expand Down
53 changes: 53 additions & 0 deletions core/core/src/utility.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import React, { MouseEvent } from 'react';

/**
* position in the stories source code
* usually taken from AST traverse loaders
Expand Down Expand Up @@ -125,3 +127,54 @@ export interface Imports {
* default export keyword
*/
export const defaultExport = 'default';

/**
* an item in the ActionBar component
*/
export interface ActionItem {
/**
* optional id, used if title is not set
*/
id?: string;
/**
* title - if a string, will use the built-in components, else can prvide custom React component
*/
node: React.ReactNode;

/**
* if the title is a string and href is set will use a default `<Link />` component
*/
href?: string;

/**
* if the title is a string and href is not set, onClick will be used on a `<Button />` component
*/
onClick?: (e: MouseEvent<HTMLButtonElement>) => void | boolean;
/**
* hide an action item
*/
hidden?: boolean;

/**
* optional order, if not provided will use the natural order of items from right to left
*/
order?: number;

/**
* optional group. ActionItems in the same group will not be separated by horizonal margin
*/
group?: string | number;

/**
* optional label visible to screen readers for aria accessibility.
*/
'aria-label'?: string;

/**
* panel for Tab-enabled UI, where an action item can open up a panel with tabs
* in this case, the onClick function can return true/false whether to open up the panel
*/
panel?: React.ReactNode;
}

export type ActionItems = ActionItem[];
4 changes: 2 additions & 2 deletions core/instrument/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
"@rollup/plugin-node-resolve": "^7.1.1",
"@types/find-cache-dir": "^3.2.0",
"@types/hosted-git-info": "^3.0.0",
"@types/jest": "^25.1.2",
"@types/jest": "^26.0.10",
"cross-env": "^5.2.1",
"eslint": "^6.5.1",
"jest": "^24.9.0"
"jest": "^26.4.2"
},
"browser": {
"fs": false
Expand Down
12 changes: 6 additions & 6 deletions core/instrument/test/__snapshots__/esm-hoisted.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ Object {
"@rollup/plugin-node-resolve": "^7.1.1",
"@types/find-cache-dir": "^3.2.0",
"@types/hosted-git-info": "^3.0.0",
"@types/jest": "^25.1.2",
"@types/jest": "^26.0.10",
"cross-env": "^5.2.1",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"jest": "^26.4.2",
},
"fileHash": "c530e9236c215c5023fe34f23def3047",
"name": "@component-controls/instrument",
Expand Down Expand Up @@ -136,10 +136,10 @@ Object {
"@rollup/plugin-node-resolve": "^7.1.1",
"@types/find-cache-dir": "^3.2.0",
"@types/hosted-git-info": "^3.0.0",
"@types/jest": "^25.1.2",
"@types/jest": "^26.0.10",
"cross-env": "^5.2.1",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"jest": "^26.4.2",
},
"fileHash": "9b19ea69af761f36bd07998cc518decf",
"name": "@component-controls/instrument",
Expand Down Expand Up @@ -239,10 +239,10 @@ Object {
"@rollup/plugin-node-resolve": "^7.1.1",
"@types/find-cache-dir": "^3.2.0",
"@types/hosted-git-info": "^3.0.0",
"@types/jest": "^25.1.2",
"@types/jest": "^26.0.10",
"cross-env": "^5.2.1",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"jest": "^26.4.2",
},
"fileHash": "bb3ac5be32f72100f7edcb5a37624298",
"name": "@component-controls/instrument",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ Object {
"@rollup/plugin-node-resolve": "^7.1.1",
"@types/find-cache-dir": "^3.2.0",
"@types/hosted-git-info": "^3.0.0",
"@types/jest": "^25.1.2",
"@types/jest": "^26.0.10",
"cross-env": "^5.2.1",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"jest": "^26.4.2",
},
"fileHash": "cac312f6f8973c26a9f69bc06acfd5fd",
"name": "@component-controls/instrument",
Expand Down Expand Up @@ -125,10 +125,10 @@ Object {
"@rollup/plugin-node-resolve": "^7.1.1",
"@types/find-cache-dir": "^3.2.0",
"@types/hosted-git-info": "^3.0.0",
"@types/jest": "^25.1.2",
"@types/jest": "^26.0.10",
"cross-env": "^5.2.1",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"jest": "^26.4.2",
},
"fileHash": "af4b3281bbce20b0dd84e8c002974c7c",
"name": "@component-controls/instrument",
Expand Down Expand Up @@ -210,10 +210,10 @@ Object {
"@rollup/plugin-node-resolve": "^7.1.1",
"@types/find-cache-dir": "^3.2.0",
"@types/hosted-git-info": "^3.0.0",
"@types/jest": "^25.1.2",
"@types/jest": "^26.0.10",
"cross-env": "^5.2.1",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"jest": "^26.4.2",
},
"fileHash": "c0980390f5f682ef4cb5b3d36d39335e",
"name": "@component-controls/instrument",
Expand Down
12 changes: 6 additions & 6 deletions core/instrument/test/__snapshots__/esm-parameters.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ Object {
"@rollup/plugin-node-resolve": "^7.1.1",
"@types/find-cache-dir": "^3.2.0",
"@types/hosted-git-info": "^3.0.0",
"@types/jest": "^25.1.2",
"@types/jest": "^26.0.10",
"cross-env": "^5.2.1",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"jest": "^26.4.2",
},
"fileHash": "9c22f6bdeb80c60a4dcfc1fe822f5f3b",
"name": "@component-controls/instrument",
Expand Down Expand Up @@ -138,10 +138,10 @@ Object {
"@rollup/plugin-node-resolve": "^7.1.1",
"@types/find-cache-dir": "^3.2.0",
"@types/hosted-git-info": "^3.0.0",
"@types/jest": "^25.1.2",
"@types/jest": "^26.0.10",
"cross-env": "^5.2.1",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"jest": "^26.4.2",
},
"fileHash": "8d5d8b91872154dc5d9f2bae81990c2f",
"name": "@component-controls/instrument",
Expand Down Expand Up @@ -243,10 +243,10 @@ Object {
"@rollup/plugin-node-resolve": "^7.1.1",
"@types/find-cache-dir": "^3.2.0",
"@types/hosted-git-info": "^3.0.0",
"@types/jest": "^25.1.2",
"@types/jest": "^26.0.10",
"cross-env": "^5.2.1",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"jest": "^26.4.2",
},
"fileHash": "63ade20bb777cbf8acf363a8059b66af",
"name": "@component-controls/instrument",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2399,10 +2399,10 @@ Object {
"@rollup/plugin-node-resolve": "^7.1.1",
"@types/find-cache-dir": "^3.2.0",
"@types/hosted-git-info": "^3.0.0",
"@types/jest": "^25.1.2",
"@types/jest": "^26.0.10",
"cross-env": "^5.2.1",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"jest": "^26.4.2",
},
"fileHash": "0de7221ca26b66ff42f614448352017c",
"name": "@component-controls/instrument",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ Object {
"theme-ui": "^0.4.0-rc.1",
},
"devDependencies": Object {
"@component-controls/jest-snapshots": "^1.21.0",
"@component-controls/ts-markdown-docs": "^1.21.0",
"@theme-ui/presets": "^0.3.0",
"@types/jest": "^25.1.2",
"@types/lunr": "^2.3.3",
"@types/mdx-js__react": "^1.5.1",
"@types/react-frame-component": "^4.1.1",
Expand All @@ -92,7 +92,6 @@ Object {
"@types/stringify-object": "^3.2.0",
"cross-env": "^5.2.1",
"eslint": "^6.5.1",
"jest": "^24.9.0",
},
"fileHash": "53689598fe7786493f4584ab098c73cc",
"name": "@component-controls/blocks",
Expand Down Expand Up @@ -138,10 +137,10 @@ Object {
"@rollup/plugin-node-resolve": "^7.1.1",
"@types/find-cache-dir": "^3.2.0",
"@types/hosted-git-info": "^3.0.0",
"@types/jest": "^25.1.2",
"@types/jest": "^26.0.10",
"cross-env": "^5.2.1",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"jest": "^26.4.2",
},
"fileHash": "a62e1dde0ad3643683513e77602cc630",
"name": "@component-controls/instrument",
Expand Down
Loading

0 comments on commit 02a3e0d

Please sign in to comment.