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
6248014
commit d2f2830
Showing
12 changed files
with
69 additions
and
40 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
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
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
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 @@ | ||
import React from "react"; | ||
import { css } from "@emotion/react"; | ||
import { mount } from "enzyme"; | ||
|
||
function cssSpecs(Loader: typeof React.Component): void { | ||
describe("css props", () => { | ||
it("should apply the override if passed a string", () => { | ||
const loader = mount( | ||
<Loader css={"backface-visibility: hidden; box-decoration-break: slice;"} /> | ||
); | ||
expect(loader).toHaveStyleRule("backface-visibility", "hidden"); | ||
expect(loader).toHaveStyleRule("box-decoration-break", "slice"); | ||
}); | ||
|
||
it("should apply the override if passed an object", () => { | ||
const loader = mount( | ||
<Loader css={{ backfaceVisibility: "hidden", boxDecorationBreak: "slice" }} /> | ||
); | ||
expect(loader).toHaveStyleRule("backface-visibility", "hidden"); | ||
expect(loader).toHaveStyleRule("box-decoration-break", "slice"); | ||
}); | ||
|
||
it("should apply the override if passed an css template using emotion", () => { | ||
const loader = mount( | ||
<Loader | ||
css={css` | ||
backface-visibility: hidden; | ||
box-decoration-break: slice; | ||
`} | ||
/> | ||
); | ||
expect(loader).toHaveStyleRule("backface-visibility", "hidden"); | ||
expect(loader).toHaveStyleRule("box-decoration-break", "slice"); | ||
}); | ||
}); | ||
} | ||
|
||
export default cssSpecs; |
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,3 @@ | ||
export { default as commonSpecs } from "./commonSpecs"; | ||
export { default as cssSpecs } from "./cssSpecs"; | ||
export { default as speedMultiplierSpecs } from "./speedMultiplierSpecs"; |
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