with width and height', () => {
- const result = render(
)
+ const result = render(
)
expect(result).toHaveStyleRule('width', '10px')
expect(result).toHaveStyleRule('height', '10px')
})
it('should have no axe violations', async () => {
- const {container} = HTMLRender(
)
+ const {container} = HTMLRender(
)
const results = await axe(container)
expect(results).toHaveNoViolations()
cleanup()
})
it('renders {borderRadius: 50%}', () => {
- expect(render(
)).toHaveStyleRule('border-radius', '50%')
+ expect(render(
)).toHaveStyleRule('border-radius', '50%')
})
it('respects the bg prop', () => {
- expect(render(
)).toHaveStyleRule('background-color', colors.red[5])
+ expect(render(
)).toHaveStyleRule('background-color', colors.red[5])
})
it('has a default size', () => {
- const result = render(
)
+ const result = render(
)
expect(result).toHaveStyleRule('width', '32px')
expect(result).toHaveStyleRule('height', '32px')
})
+
+ it('respects the "as" prop', () => {
+ expect(render(
).type).toEqual('span')
+ })
})
diff --git a/src/__tests__/StateLabel.js b/src/__tests__/StateLabel.js
index e6b0e21a362..0e8f5ba48be 100644
--- a/src/__tests__/StateLabel.js
+++ b/src/__tests__/StateLabel.js
@@ -9,13 +9,7 @@ import {Deprecations} from '../utils/deprecate'
expect.extend(toHaveNoViolations)
describe('StateLabel', () => {
- behavesAsComponent(StateLabel, [COMMON], () =>
Open , {
- // Rendering a StyledOcticon seems to break getComputedStyles, which
- // the sx prop implementation test uses to make sure the prop is working correctly.
- // Despite my best efforts, I cannot figure out why this is happening. So,
- // unfortunately, we will simply skip this test.
- skipSx: true
- })
+ behavesAsComponent(StateLabel, [COMMON], () =>
Open )
checkExports('StateLabel', {
default: StateLabel
diff --git a/src/__tests__/StyledOcticon.js b/src/__tests__/StyledOcticon.js
deleted file mode 100644
index f1ffaca97f6..00000000000
--- a/src/__tests__/StyledOcticon.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import React from 'react'
-import {X} from '@primer/octicons-react'
-import {StyledOcticon} from '..'
-import {behavesAsComponent, checkExports} from '../utils/testing'
-import {COMMON} from '../constants'
-import {render as HTMLRender, cleanup} from '@testing-library/react'
-import {axe, toHaveNoViolations} from 'jest-axe'
-import 'babel-polyfill'
-expect.extend(toHaveNoViolations)
-
-describe('StyledOcticon', () => {
- behavesAsComponent(StyledOcticon, [COMMON], () =>
)
-
- checkExports('StyledOcticon', {
- default: StyledOcticon
- })
-
- it('implements system props', () => {
- expect(StyledOcticon).toImplementSystemProps(COMMON)
- })
-
- it('should have no axe violations', async () => {
- const {container} = HTMLRender(
)
- const results = await axe(container)
- expect(results).toHaveNoViolations()
- cleanup()
- })
-})
diff --git a/src/__tests__/__snapshots__/CircleBadge.js.snap b/src/__tests__/__snapshots__/CircleBadge.js.snap
index cc47f0aa165..2aeded5fea5 100644
--- a/src/__tests__/__snapshots__/CircleBadge.js.snap
+++ b/src/__tests__/__snapshots__/CircleBadge.js.snap
@@ -10,21 +10,24 @@ exports[`CircleBadge CircleBadge.Icon renders consistently 1`] = `
",
+ }
+ }
+ fill="currentColor"
height={16}
role="img"
style={
Object {
"display": "inline-block",
- "fill": "currentColor",
"userSelect": "none",
"verticalAlign": "text-bottom",
}
}
viewBox="0 0 16 16"
width={16}
->
-
-
+/>
`;
exports[`CircleBadge renders consistently 1`] = `
diff --git a/src/__tests__/__snapshots__/CircleOcticon.js.snap b/src/__tests__/__snapshots__/CircleOcticon.js.snap
index 4d1315f7db0..61fb01bfea1 100644
--- a/src/__tests__/__snapshots__/CircleOcticon.js.snap
+++ b/src/__tests__/__snapshots__/CircleOcticon.js.snap
@@ -44,25 +44,25 @@ exports[`CircleOcticon renders consistently 1`] = `
>
",
+ }
+ }
+ fill="currentColor"
height={32}
role="img"
style={
Object {
"display": "inline-block",
- "fill": "currentColor",
"userSelect": "none",
"verticalAlign": "text-bottom",
}
}
- viewBox="0 0 12 16"
- width={24}
- >
-
-
+ viewBox="0 0 24 24"
+ width={32}
+ />
`;
diff --git a/src/__tests__/__snapshots__/SelectMenu.js.snap b/src/__tests__/__snapshots__/SelectMenu.js.snap
index c8b29fbfa91..ef1ea8c66ac 100644
--- a/src/__tests__/__snapshots__/SelectMenu.js.snap
+++ b/src/__tests__/__snapshots__/SelectMenu.js.snap
@@ -353,24 +353,24 @@ exports[`SelectMenu right-aligned modal has right: 0px 1`] = `