Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add SocialIcon unit tests #936

Closed
Closed
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
0ddc957
test: add unit tests for SocialIcon component
devin-ai-integration[bot] Jan 28, 2025
6892469
test: improve SocialIcon test coverage for hover states and transitions
devin-ai-integration[bot] Jan 28, 2025
95a6769
fix: add missing closing brace in SocialIcon test
devin-ai-integration[bot] Jan 28, 2025
459e8f4
test: add test case for SocialIcon without ColoredIcon prop
devin-ai-integration[bot] Jan 28, 2025
0fbc3a2
test: add test case for transition styles
devin-ai-integration[bot] Jan 28, 2025
1f66ef5
test: fix style assertions in SocialIcon tests
devin-ai-integration[bot] Jan 28, 2025
52a7b59
test: improve SocialIcon test coverage with style and hover assertions
devin-ai-integration[bot] Jan 28, 2025
9e2303c
test: update style assertions to match testing library expectations
devin-ai-integration[bot] Jan 28, 2025
c81decd
test: update style assertions to use object format consistently
devin-ai-integration[bot] Jan 28, 2025
d1d4e07
test: update style assertions to use string values for opacity and th…
devin-ai-integration[bot] Jan 28, 2025
1beb6e5
test: update style assertions with complete style properties
devin-ai-integration[bot] Jan 28, 2025
efae99d
test: add theme-based style assertions for width and height
devin-ai-integration[bot] Jan 28, 2025
4f05fbb
test: add comprehensive hover state transition tests
devin-ai-integration[bot] Jan 28, 2025
6321771
test: update style assertions to use individual checks and RGB values
devin-ai-integration[bot] Jan 28, 2025
e345eff
test: update remaining style assertions to use individual checks and …
devin-ai-integration[bot] Jan 28, 2025
2790319
test: add key prop and component type assertions
devin-ai-integration[bot] Jan 28, 2025
a2000fc
test: add test case for undefined color behavior
devin-ai-integration[bot] Jan 28, 2025
fe249d2
test: add comprehensive style assertions for StyledColoredIcon
devin-ai-integration[bot] Jan 28, 2025
4754f72
test: add additional test cases for theme spacing and transitions
devin-ai-integration[bot] Jan 28, 2025
524c26b
test: update style assertions to use toHaveAttribute with stringConta…
devin-ai-integration[bot] Jan 28, 2025
2b2c9e0
test: update remaining style assertions to use toHaveStyle
devin-ai-integration[bot] Jan 29, 2025
ee08844
test: update style assertions to use theme values and consistent obje…
devin-ai-integration[bot] Jan 29, 2025
02370a8
test: update remaining style assertions to use theme values
devin-ai-integration[bot] Jan 29, 2025
7710336
test: update remaining style assertions to use getComputedStyle
devin-ai-integration[bot] Jan 29, 2025
7de8c34
test: add transition timing assertions
devin-ai-integration[bot] Jan 29, 2025
e64dad6
test: update style assertions to use toHaveStyle for more reliable te…
devin-ai-integration[bot] Jan 29, 2025
582c0f2
test: update remaining style assertions to use toHaveStyle
devin-ai-integration[bot] Jan 29, 2025
7dc2a74
test: update remaining style assertions to use toHaveStyle consistently
devin-ai-integration[bot] Jan 29, 2025
c03681d
test: update coverage configuration with thresholds and reporters
devin-ai-integration[bot] Jan 29, 2025
1d9f2c4
test: add lcov reporter and coverage directory configuration
devin-ai-integration[bot] Jan 29, 2025
707f9f0
test: update style assertions to target correct styled components
devin-ai-integration[bot] Jan 29, 2025
1472600
test: add sonar coverage reporter and improve coverage configuration
devin-ai-integration[bot] Jan 29, 2025
3f38879
chore: add sonar-project.properties for coverage reporting
devin-ai-integration[bot] Jan 29, 2025
692424b
ci: add SonarCloud coverage reporting step
devin-ai-integration[bot] Jan 29, 2025
8c3e5dc
ci: update SonarCloud configuration for better coverage reporting
devin-ai-integration[bot] Jan 29, 2025
ca4a1d6
ci: update coverage reporting with v4 upload-artifact
devin-ai-integration[bot] Jan 29, 2025
367450f
ci: fix coverage path handling for SonarCloud
devin-ai-integration[bot] Jan 29, 2025
720969f
test: update style assertions to use getComputedStyle instead of toHa…
devin-ai-integration[bot] Jan 29, 2025
4c88b0c
test: update style assertions to use getComputedStyle with comprehens…
devin-ai-integration[bot] Jan 29, 2025
6dbf07c
ci: improve coverage artifact handling and path fixing for SonarCloud
devin-ai-integration[bot] Jan 29, 2025
1440c02
ci: improve coverage configuration and reporting
devin-ai-integration[bot] Jan 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: add missing closing brace in SocialIcon test
Co-Authored-By: Leon Talbert <[email protected]>
devin-ai-integration[bot] and LeonmanRolls committed Jan 28, 2025

Verified

This commit was signed with the committer’s verified signature. The key has expired.
viccuad Víctor Cuadrado Juan
commit 95a6769c6f58aaafdd5515c3c75e38956463df31
1 change: 1 addition & 0 deletions src/components/SocialIcon.test.tsx
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
expect(icon).toBeInTheDocument()
expect(link).toHaveAttribute('href', 'https://example.com')
expect(link).toHaveAttribute('target', '_blank')
expect(icon.parentElement).toHaveStyle({ fill: expect.stringContaining('greyPrimary') })

Check failure on line 23 in src/components/SocialIcon.test.tsx

GitHub Actions / coverage

src/components/SocialIcon.test.tsx > SocialIcon > should render icon and external link with correct attributes

Error: expect(element).toHaveStyle() - Expected + Received - fill: StringContaining; ❯ src/components/SocialIcon.test.tsx:23:32
})

it('should render and handle colored icon correctly', () => {
@@ -36,7 +36,7 @@

expect(defaultIcon).toBeInTheDocument()
expect(coloredIcon).toBeInTheDocument()
expect(coloredIcon.parentElement).toHaveStyle({ opacity: '0' })

Check failure on line 39 in src/components/SocialIcon.test.tsx

GitHub Actions / coverage

src/components/SocialIcon.test.tsx > SocialIcon > should render and handle colored icon correctly

Error: expect(element).toHaveStyle() - Expected + Received - opacity: 0; ❯ src/components/SocialIcon.test.tsx:39:39
})

it('should handle hover states correctly', async () => {
@@ -53,7 +53,7 @@
const defaultIcon = screen.getByTestId('mock-icon')
const coloredIcon = screen.getByTestId('mock-colored-icon')

expect(defaultIcon.parentElement).toHaveStyle({ fill: expect.stringContaining('greyPrimary') })

Check failure on line 56 in src/components/SocialIcon.test.tsx

GitHub Actions / coverage

src/components/SocialIcon.test.tsx > SocialIcon > should handle hover states correctly

Error: expect(element).toHaveStyle() - Expected + Received - fill: StringContaining; ❯ src/components/SocialIcon.test.tsx:56:39
expect(coloredIcon.parentElement).toHaveStyle({ opacity: '0' })

await userEvent.hover(link)
@@ -78,7 +78,7 @@
const link = screen.getByRole('link')
const coloredIcon = screen.getByTestId('mock-colored-icon')

expect(coloredIcon.parentElement).toHaveStyle({ opacity: '0' })

Check failure on line 81 in src/components/SocialIcon.test.tsx

GitHub Actions / coverage

src/components/SocialIcon.test.tsx > SocialIcon > should show colored icon on hover when ColoredIcon is provided

Error: expect(element).toHaveStyle() - Expected + Received - opacity: 0; ❯ src/components/SocialIcon.test.tsx:81:39
await userEvent.hover(link)
expect(coloredIcon.parentElement).toHaveStyle({ opacity: '1' })
})
@@ -95,7 +95,8 @@
const link = screen.getByRole('link')
const icon = screen.getByTestId('mock-icon')

expect(icon.parentElement).toHaveStyle({ fill: expect.stringContaining('greyPrimary') })

Check failure on line 98 in src/components/SocialIcon.test.tsx

GitHub Actions / coverage

src/components/SocialIcon.test.tsx > SocialIcon > should change icon color on hover when color prop is provided

Error: expect(element).toHaveStyle() - Expected + Received - fill: StringContaining; ❯ src/components/SocialIcon.test.tsx:98:32
await userEvent.hover(link)
expect(icon.parentElement).toHaveStyle({ fill: customColor })
})
})