CEC-464 can filters forms (#118)
* can filters forms and lists * unit tests * updating warnings and tests * merge develop * fixed snapshots * update jest mocks * updating tests
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`TabPanel Render 1`] = `
|
||||
<div>
|
||||
<div
|
||||
aria-labelledby="tab-0"
|
||||
id="tabpanel-0"
|
||||
role="tabpanel"
|
||||
>
|
||||
<div
|
||||
class="MuiBox-root MuiBox-root-1"
|
||||
>
|
||||
<div>
|
||||
Test
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
24
src/components/Controls/TabPanel/index.jsx
Normal file
24
src/components/Controls/TabPanel/index.jsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import React from "react";
|
||||
import { Box } from "@material-ui/core";
|
||||
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
|
||||
return (
|
||||
<div
|
||||
role="tabpanel"
|
||||
hidden={value !== index}
|
||||
id={`tabpanel-${index}`}
|
||||
aria-labelledby={`tab-${index}`}
|
||||
{...other}
|
||||
>
|
||||
{value === index && (
|
||||
<Box sx={{ p: 3 }}>
|
||||
{children}
|
||||
</Box>
|
||||
)}
|
||||
</div >
|
||||
);
|
||||
}
|
||||
|
||||
export default TabPanel;
|
||||
21
src/components/Controls/TabPanel/index.test.jsx
Normal file
21
src/components/Controls/TabPanel/index.test.jsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import { render, waitFor } from "@testing-library/react";
|
||||
|
||||
import TabPanel from "./index"
|
||||
|
||||
|
||||
const renderTabPanel = async () => {
|
||||
const { container } = render(
|
||||
<TabPanel value={0} index={0}>
|
||||
<div>Test</div>
|
||||
</TabPanel>
|
||||
);
|
||||
await waitFor(() => { });
|
||||
return container;
|
||||
};
|
||||
|
||||
describe("TabPanel", () => {
|
||||
it("Render", async () => {
|
||||
const container = await renderTabPanel();
|
||||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user