mirror of
https://github.com/prymitive/karma
synced 2026-05-09 03:36:44 +00:00
feat(storybook): add more stories
This commit is contained in:
@@ -8,18 +8,28 @@ import { OverviewModalContent } from "./OverviewModalContent";
|
||||
|
||||
import "Styles/Percy.scss";
|
||||
|
||||
storiesOf("OverviewModal", module)
|
||||
.addDecorator(storyFn => (
|
||||
storiesOf("OverviewModal", module).add("OverviewModal", () => {
|
||||
const Modal = ({ children }) => (
|
||||
<div>
|
||||
<div className="modal-dialog modal-lg" role="document">
|
||||
<div className="modal-content">{storyFn()}</div>
|
||||
<div className="modal-content">{children}</div>
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
.add("OverviewModal", () => {
|
||||
const alertStore = new AlertStore([]);
|
||||
);
|
||||
|
||||
MockGrid(alertStore);
|
||||
const alertStore = new AlertStore([]);
|
||||
MockGrid(alertStore);
|
||||
|
||||
return <OverviewModalContent alertStore={alertStore} onHide={() => {}} />;
|
||||
});
|
||||
const emptyAlertStore = new AlertStore([]);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Modal>
|
||||
<OverviewModalContent alertStore={alertStore} onHide={() => {}} />
|
||||
</Modal>
|
||||
<Modal>
|
||||
<OverviewModalContent alertStore={emptyAlertStore} onHide={() => {}} />
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
@@ -177,6 +177,45 @@ storiesOf("SilenceModal", module)
|
||||
overwriteRoutes: true
|
||||
});
|
||||
|
||||
return (
|
||||
<Modal>
|
||||
<SilenceModalContent
|
||||
alertStore={alertStore}
|
||||
silenceFormStore={silenceFormStore}
|
||||
settingsStore={settingsStore}
|
||||
onHide={() => {}}
|
||||
onDeleteModalClose={() => {}}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
})
|
||||
.add("Empty Browser", () => {
|
||||
const alertStore = new AlertStore([]);
|
||||
const settingsStore = new Settings();
|
||||
const silenceFormStore = new SilenceFormStore();
|
||||
|
||||
silenceFormStore.tab.current = SilenceTabNames.Browser;
|
||||
|
||||
alertStore.data.upstreams = {
|
||||
instances: [
|
||||
{
|
||||
name: "am1",
|
||||
cluster: "am",
|
||||
clusterMembers: ["am1"],
|
||||
uri: "http://localhost:9093",
|
||||
publicURI: "http://example.com",
|
||||
error: "",
|
||||
version: "0.15.3",
|
||||
headers: {}
|
||||
}
|
||||
],
|
||||
clusters: { am: ["am1"] }
|
||||
};
|
||||
|
||||
fetchMock.mock("begin:/silences.json?", [], {
|
||||
overwriteRoutes: true
|
||||
});
|
||||
|
||||
return (
|
||||
<Modal>
|
||||
<SilenceModalContent
|
||||
|
||||
Reference in New Issue
Block a user