-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2865 from kiwicom/chore/upgrade-sc-to-version-5
chore: upgrade styled-components to v5
- Loading branch information
Showing
9 changed files
with
855 additions
and
1,317 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
52 changes: 35 additions & 17 deletions
52
packages/orbit-components/src/Mobile/__tests__/index.test.js
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 |
---|---|---|
@@ -1,31 +1,49 @@ | ||
// @flow strict | ||
|
||
import * as React from "react"; | ||
import { render, screen } from "@testing-library/react"; | ||
import { render } from "@testing-library/react"; | ||
|
||
import { getBreakpointWidth } from "../../utils/mediaQuery/index"; | ||
import { QUERIES } from "../../utils/mediaQuery/consts"; | ||
import theme from "../../defaultTheme"; | ||
import Mobile from ".."; | ||
|
||
describe("Mobile", () => { | ||
it("should be visible on smallMobile, largeMobile and tablet", () => { | ||
render(<Mobile>kek</Mobile>); | ||
const { container } = render(<Mobile>kek</Mobile>); | ||
expect(container.firstChild).toMatchInlineSnapshot(` | ||
@media (min-width:414px) { | ||
.c0 { | ||
display: inline-block; | ||
} | ||
} | ||
expect(screen.getByText("kek")).toHaveStyleRule("display", "inline-block", { | ||
media: getBreakpointWidth(QUERIES.LARGEMOBILE, theme), | ||
}); | ||
@media (min-width:576px) { | ||
.c0 { | ||
display: inline-block; | ||
} | ||
} | ||
expect(screen.getByText("kek")).toHaveStyleRule("display", "inline-block", { | ||
media: getBreakpointWidth(QUERIES.TABLET, theme), | ||
}); | ||
@media (min-width:768px) { | ||
.c0 { | ||
display: inline-block; | ||
} | ||
} | ||
expect(screen.getByText("kek")).toHaveStyleRule("display", "none", { | ||
media: getBreakpointWidth(QUERIES.LARGEDESKTOP, theme), | ||
}); | ||
@media (min-width:992px) { | ||
.c0 { | ||
display: none; | ||
} | ||
} | ||
expect(screen.getByText("kek")).toHaveStyleRule("display", "none", { | ||
media: getBreakpointWidth(QUERIES.DESKTOP, theme), | ||
}); | ||
@media (min-width:1200px) { | ||
.c0 { | ||
display: none; | ||
} | ||
} | ||
<div | ||
class="c0" | ||
> | ||
kek | ||
</div> | ||
`); | ||
}); | ||
}); |
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
Oops, something went wrong.