Skip to content

Commit

Permalink
Remove StyledOcticon
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrohan committed Sep 11, 2023
1 parent 2a520cc commit 273438e
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 132 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ import {test, expect} from '@playwright/test'
import {visit} from '../test-helpers/storybook'
import {themes} from '../test-helpers/themes'

test.describe('StyledOcticon', () => {
test.describe('Octicon', () => {
test.describe('Default', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-styledocticon--default',
id: 'components-octicon--default',
globals: {
colorScheme: theme,
},
})

// Default state
expect(await page.screenshot()).toMatchSnapshot(`StyledOcticon.Default.${theme}.png`)
expect(await page.screenshot()).toMatchSnapshot(`Octicon.Default.${theme}.png`)
})

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'components-styledocticon--default',
id: 'components-octicon--default',
globals: {
colorScheme: theme,
},
Expand All @@ -36,19 +36,19 @@ test.describe('StyledOcticon', () => {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'components-styledocticon--playground',
id: 'components-octicon--playground',
globals: {
colorScheme: theme,
},
})

// Default state
expect(await page.screenshot()).toMatchSnapshot(`StyledOcticon.Playground.${theme}.png`)
expect(await page.screenshot()).toMatchSnapshot(`Octicon.Playground.${theme}.png`)
})

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'components-styledocticon--playground',
id: 'components-octicon--playground',
globals: {
colorScheme: theme,
},
Expand Down
71 changes: 29 additions & 42 deletions examples/nextjs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions script/generate-e2e-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1114,15 +1114,15 @@ const components = new Map([
},
],
[
'StyledOcticon',
'Octicon',
{
stories: [
{
id: 'components-styledocticon--default',
id: 'components-octicon--default',
name: 'Default',
},
{
id: 'components-styledocticon--playground',
id: 'components-octicon--playground',
name: 'Playground',
},
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react'
import {Meta, ComponentStory} from '@storybook/react'
import StyledOcticon from './StyledOcticon'
import Octicon from './Octicon'
import {HeartFillIcon} from '@primer/octicons-react'

export default {
title: 'Components/StyledOcticon',
component: StyledOcticon,
} as Meta<typeof StyledOcticon>
title: 'Components/Octicon',
component: Octicon,
} as Meta<typeof Octicon>

export const Default = () => <StyledOcticon icon={HeartFillIcon} size={32} />
export const Default = () => <Octicon icon={HeartFillIcon} size={32} />

export const Playground: ComponentStory<typeof StyledOcticon> = args => <StyledOcticon icon={HeartFillIcon} {...args} />
export const Playground: ComponentStory<typeof Octicon> = args => <Octicon icon={HeartFillIcon} {...args} />

Playground.args = {
ariaLabel: 'Heart',
Expand Down
5 changes: 0 additions & 5 deletions src/StyledOcticon/StyledOcticon.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions src/StyledOcticon/index.ts

This file was deleted.

25 changes: 0 additions & 25 deletions src/__tests__/StyledOcticon.test.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions src/__tests__/StyledOcticon.types.test.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions src/__tests__/__snapshots__/StyledOcticon.test.tsx.snap

This file was deleted.

1 change: 0 additions & 1 deletion src/__tests__/__snapshots__/exports.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ exports[`@primer/react should not update exports without a semver change 1`] = `
"Spinner",
"SplitPageLayout",
"StateLabel",
"StyledOcticon",
"SubNav",
"TabNav",
"Text",
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/storybook.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const allowlist = [
'IconButton',
'FilteredActionList',
'Link',
'Octicon',
'Pagehead',
'Pagination',
'ProgressBar',
Expand All @@ -38,7 +39,6 @@ const allowlist = [
'SegmentedControl',
'Spinner',
'StateLabel',
'StyledOcticon',
'SubNav',
'TabNav',
'Textarea',
Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ export {default as Spinner} from './Spinner'
export type {SpinnerProps} from './Spinner'
export {default as StateLabel} from './StateLabel'
export type {StateLabelProps} from './StateLabel'
export {default as StyledOcticon} from './StyledOcticon'
export type {StyledOcticonProps} from './StyledOcticon'
export {default as SubNav} from './SubNav'
export type {SubNavProps, SubNavLinkProps, SubNavLinksProps} from './SubNav'
export {default as ToggleSwitch} from './ToggleSwitch'
Expand Down

0 comments on commit 273438e

Please sign in to comment.