Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b09732
commit dcd1254
Showing
4 changed files
with
44 additions
and
24 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
35 changes: 35 additions & 0 deletions
35
packages/orbit-components/src/Modal/ModalFooter/__tests__/index.test.tsx
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,35 @@ | ||
import { render, screen } from "@testing-library/react"; | ||
import React from "react"; | ||
|
||
import ModalFooter from ".."; | ||
import Button from "../../../Button"; | ||
import { getBreakpointWidth } from "../../../utils/mediaQuery"; | ||
import theme from "../../../defaultTheme"; | ||
|
||
describe("ModalFooter", () => { | ||
it("should render save button with flex-end", () => { | ||
render( | ||
<ModalFooter dataTest="footer"> | ||
{null} | ||
<Button type="primary">Save</Button> | ||
</ModalFooter>, | ||
); | ||
|
||
expect(screen.getByTestId("footer")).toHaveStyleRule("justify-content", "flex-end", { | ||
media: getBreakpointWidth("largeMobile", theme), | ||
}); | ||
}); | ||
|
||
it("should render buttons with space-between", () => { | ||
render( | ||
<ModalFooter dataTest="footer"> | ||
<Button type="secondary">Cancel</Button> | ||
<Button type="primary">Save</Button> | ||
</ModalFooter>, | ||
); | ||
|
||
expect(screen.getByTestId("footer")).toHaveStyleRule("justify-content", "space-between", { | ||
media: getBreakpointWidth("largeMobile", theme), | ||
}); | ||
}); | ||
}); |
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