Skip to content

Commit

Permalink
Refactor and update visual snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
tujoworker committed Mar 31, 2023
1 parent cbb98d6 commit a78a5fa
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const IconInheritSized = () => (
)

export const IconMedium = () => {
if (!global.IS_TEST) {
if (!globalThis.IS_TEST) {
return null
}

Expand All @@ -78,8 +78,8 @@ export const IconMedium = () => {
)
}

export const IconPrimaryTest = () => {
if (!global.IS_TEST) {
export const AllPrimaryIcons = () => {
if (!globalThis.IS_TEST) {
return null
}

Expand Down Expand Up @@ -113,8 +113,8 @@ export const IconPrimaryTest = () => {
)
}

export const IconSecondary = () => {
if (!global.IS_TEST) {
export const AllSecondaryIcons = () => {
if (!globalThis.IS_TEST) {
return null
}

Expand Down Expand Up @@ -154,16 +154,6 @@ export const IconSecondary = () => {
)
}

export default function IconTests() {
return (
<>
<IconMedium />
<IconPrimaryTest />
<IconSecondary />
</>
)
}

export const IconColors = () => {
return (
<ComponentBox data-visual-test="icon-colors" scope={{ BellMedium }}>
Expand All @@ -177,3 +167,12 @@ export const IconColors = () => {
</ComponentBox>
)
}

export function AllIconsTest() {
return (
<>
<AllPrimaryIcons />
<AllSecondaryIcons />
</>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
showTabs: true
---

import IconTests, {
import {
IconDefault,
IconBorder,
IconInheritSized,
Expand All @@ -28,5 +28,3 @@ import IconTests, {
All of these methods will output the same color

<IconColors />

<IconTests />
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
draft: true
---

import {
IconMedium,
AllIconsTest,
} from 'Docs/uilib/components/icon/Examples'

<IconMedium />

<AllIconsTest />
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ describe('Icon', () => {
})
expect(screenshot).toMatchImageSnapshot()
})
})

describe('Icon', () => {
setupPageScreenshot({
url: '/uilib/components/icon/visual-tests',
})

it('have to match responsive icons', async () => {
const screenshot = await makeScreenshot({
Expand All @@ -72,12 +78,6 @@ describe('Icon', () => {
})
expect(screenshot).toMatchImageSnapshot()
})
})

describe('Icon', () => {
setupPageScreenshot({
url: '/uilib/components/icon/demos',
})

it('have to match all primary icons', async () => {
const screenshot = await makeScreenshot({
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a78a5fa

Please sign in to comment.