2020-12-15 07:21:17 +00:00
|
|
|
import React from "react";
|
|
|
|
import { Meta } from "@storybook/react";
|
|
|
|
import { MockAdminClient } from "./MockAdminClient";
|
|
|
|
import { MemoryRouter, Route } from "react-router-dom";
|
|
|
|
import rolesMock from "../realm-roles/__tests__/mock-roles.json";
|
2020-12-04 20:37:29 +00:00
|
|
|
import { RealmRoleTabs } from "../realm-roles/RealmRoleTabs";
|
2020-12-15 07:21:17 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
title: "Roles tabs",
|
2020-12-04 20:37:29 +00:00
|
|
|
component: RealmRoleTabs,
|
2020-12-15 07:21:17 +00:00
|
|
|
} as Meta;
|
|
|
|
|
2020-12-04 20:37:29 +00:00
|
|
|
export const RolesTabsExample = () => {
|
2020-12-15 07:21:17 +00:00
|
|
|
return (
|
|
|
|
<MockAdminClient mock={{ roles: { findOneById: () => rolesMock[0] } }}>
|
|
|
|
<MemoryRouter initialEntries={["/roles/1"]}>
|
|
|
|
<Route path="/roles/:id">
|
2020-12-04 20:37:29 +00:00
|
|
|
<RealmRoleTabs />
|
2020-12-15 07:21:17 +00:00
|
|
|
</Route>
|
|
|
|
</MemoryRouter>
|
|
|
|
</MockAdminClient>
|
|
|
|
);
|
|
|
|
};
|