-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Storybook of integration test docs
- Loading branch information
Showing
7 changed files
with
2,938 additions
and
93 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
import "@storybook/addon-viewport/register"; |
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,9 @@ | ||
import { configure } from '@storybook/html'; | ||
|
||
// automatically import all files ending in *.stories.js | ||
const req = require.context('../stories', true, /.stories.js$/); | ||
function loadStories() { | ||
req.keys().forEach(filename => req(filename)); | ||
} | ||
|
||
configure(loadStories, module); |
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,13 @@ | ||
const path = require("path"); | ||
|
||
module.exports = { | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.scss$/, | ||
loaders: ["style-loader", "css-loader", "sass-loader"], | ||
include: path.resolve(__dirname, "../") | ||
} | ||
] | ||
} | ||
}; |
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,38 @@ | ||
/* eslint-disable no-console, react/button-has-type */ | ||
|
||
import { document } from "global"; | ||
import { storiesOf } from "@storybook/html"; | ||
|
||
import * as snapshots from "../tests/__snapshots__/integration.test.js.snap"; | ||
import "../src/assets/css/index.scss"; | ||
import main from "../src/assets/javascript/main"; | ||
|
||
function createStory(html) { | ||
return () => { | ||
const container = document.createElement("div"); | ||
container.innerHTML = html; | ||
main(container); | ||
return container; | ||
}; | ||
} | ||
|
||
storiesOf("Basic functionality") | ||
.add("Citations", createStory(snapshots[`citations.tex 1`])) | ||
.add("Figures", createStory(snapshots[`figures.tex 1`])) | ||
.add("Footnotes", createStory(snapshots[`footnotes.tex 1`])) | ||
.add("Headings", createStory(snapshots[`headings.tex 1`])) | ||
.add("Lists", createStory(snapshots[`lists.tex 1`])) | ||
.add("Math", createStory(snapshots[`math.tex 1`])) | ||
.add("Paragraph styles", createStory(snapshots[`paragraph.tex 1`])) | ||
.add("Tables", createStory(snapshots[`tables.tex 1`])) | ||
.add("Text styles", createStory(snapshots[`text.tex 1`])) | ||
.add("URLs", createStory(snapshots[`urls.tex 1`])); | ||
|
||
storiesOf("Packages", module) | ||
.add("aa", createStory(snapshots[`aa.tex 1`])) | ||
.add("algorithm2e", createStory(snapshots[`algorithm.tex 1`])) | ||
.add("listings", createStory(snapshots[`listings.tex 1`])); | ||
|
||
storiesOf("Complete documents") | ||
.add("sample2e", createStory(snapshots[`sample2e.tex 1`])) | ||
.add("small2e", createStory(snapshots[`small2e.tex 1`])); |
Oops, something went wrong.