generated from storybookjs/addon-kit
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from chromaui/tom/ap-3340-set-sidebar-status-f…
…rom-build Set sidebar status from build result
- Loading branch information
Showing
14 changed files
with
1,620 additions
and
551 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ["@storybook/eslint-config-storybook"], | ||
extends: ["@storybook/eslint-config-storybook", "plugin:storybook/recommended"], | ||
rules: { | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"eslint-comments/disable-enable-pair": "off", | ||
"simple-import-sort/imports": "error", | ||
"simple-import-sort/exports": "error", | ||
"simple-import-sort/exports": "error" | ||
}, | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
project: ["./tsconfig.json"], | ||
project: ["./tsconfig.json"] | ||
}, | ||
plugins: ["simple-import-sort"], | ||
}; | ||
plugins: ["simple-import-sort"] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/** @type {import('ts-jest').JestConfigWithTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import { TestStatus } from "../gql/graphql"; | ||
import { testsToStatusUpdate } from "./testsToStatusUpdate"; | ||
|
||
it("handles single test", () => { | ||
expect( | ||
testsToStatusUpdate([ | ||
{ | ||
status: TestStatus.Passed, | ||
story: { | ||
storyId: "story--id", | ||
}, | ||
}, | ||
]) | ||
).toMatchInlineSnapshot(` | ||
{ | ||
"story--id": { | ||
"description": "Chromatic Visual Tests", | ||
"status": null, | ||
"title": "Visual Tests", | ||
}, | ||
} | ||
`); | ||
}); | ||
|
||
it("handles multiple tests", () => { | ||
expect( | ||
testsToStatusUpdate([ | ||
{ | ||
status: TestStatus.Pending, | ||
story: { | ||
storyId: "story--id", | ||
}, | ||
}, | ||
{ | ||
status: TestStatus.Denied, | ||
story: { | ||
storyId: "story2--id", | ||
}, | ||
}, | ||
]) | ||
).toMatchInlineSnapshot(` | ||
{ | ||
"story--id": { | ||
"description": "Chromatic Visual Tests", | ||
"status": "warn", | ||
"title": "Visual Tests", | ||
}, | ||
"story2--id": { | ||
"description": "Chromatic Visual Tests", | ||
"status": "error", | ||
"title": "Visual Tests", | ||
}, | ||
} | ||
`); | ||
}); | ||
|
||
it("handles multiple viewports", () => { | ||
expect( | ||
testsToStatusUpdate([ | ||
{ | ||
status: TestStatus.Broken, | ||
story: { | ||
storyId: "story--id", | ||
}, | ||
}, | ||
{ | ||
status: TestStatus.Pending, | ||
story: { | ||
storyId: "story--id", | ||
}, | ||
}, | ||
]) | ||
).toMatchInlineSnapshot(` | ||
{ | ||
"story--id": { | ||
"description": "Chromatic Visual Tests", | ||
"status": "error", | ||
"title": "Visual Tests", | ||
}, | ||
} | ||
`); | ||
}); | ||
|
||
it("handles multiple viewports, reverse order", () => { | ||
expect( | ||
testsToStatusUpdate([ | ||
{ | ||
status: TestStatus.Pending, | ||
story: { | ||
storyId: "story--id", | ||
}, | ||
}, | ||
{ | ||
status: TestStatus.Broken, | ||
story: { | ||
storyId: "story--id", | ||
}, | ||
}, | ||
]) | ||
).toMatchInlineSnapshot(` | ||
{ | ||
"story--id": { | ||
"description": "Chromatic Visual Tests", | ||
"status": "error", | ||
"title": "Visual Tests", | ||
}, | ||
} | ||
`); | ||
}); |
Oops, something went wrong.