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

feat: Add img component for light and dark src #3675

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

calvin-codecov
Copy link
Contributor

Description

Closes codecov/engineering-team#2812

Code Example

Notable Changes

Screenshots

Link to Sample Entry

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@codecov-qa
Copy link

codecov-qa bot commented Jan 21, 2025

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
5676 2 5674 3
View the top 2 failed tests by shortest run time
src/pages/PlanPage/subRoutes/UpgradePlanPage/UpgradeForm/Controllers/ProPlanController/BillingOptions/BillingOptions.test.tsx > BillingOptions > when rendered > planString is set to annual plan > renders annual button as "selected"
Stack Traces | 0.173s run time
Error: expect(element).toHaveClass("bg-ds-primary-base")

Expected the element to have class:
  bg-ds-primary-base
Received:
  flex-1 py-1 px-2 text-sm cursor-pointer whitespace-nowrap disabled:text-ds-gray-quaternary disabled:border-ds-gray-tertiary disabled:bg-ds-gray-primary rounded-l
 ❯ .../ProPlanController/BillingOptions/BillingOptions.test.tsx:158:27
src/pages/PlanPage/subRoutes/UpgradePlanPage/UpgradeForm/Controllers/TeamPlanController/BillingOptions/BillingOptions.test.tsx > BillingOptions > when rendered > planString is set to annual plan > renders annual button as "selected"
Stack Traces | 0.184s run time
Error: expect(element).toHaveClass("bg-ds-primary-base")

Expected the element to have class:
  bg-ds-primary-base
Received:
  flex-1 py-1 px-2 text-sm cursor-pointer whitespace-nowrap disabled:text-ds-gray-quaternary disabled:border-ds-gray-tertiary disabled:bg-ds-gray-primary rounded-l
 ❯ .../TeamPlanController/BillingOptions/BillingOptions.test.tsx:141:27

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@codecov-staging
Copy link

codecov-staging bot commented Jan 21, 2025

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
5676 2 5674 3
View the top 2 failed tests by shortest run time
src/pages/PlanPage/subRoutes/UpgradePlanPage/UpgradeForm/Controllers/ProPlanController/BillingOptions/BillingOptions.test.tsx > BillingOptions > when rendered > planString is set to annual plan > renders annual button as "selected"
Stack Traces | 0.173s run time
Error: expect(element).toHaveClass("bg-ds-primary-base")

Expected the element to have class:
  bg-ds-primary-base
Received:
  flex-1 py-1 px-2 text-sm cursor-pointer whitespace-nowrap disabled:text-ds-gray-quaternary disabled:border-ds-gray-tertiary disabled:bg-ds-gray-primary rounded-l
 ❯ .../ProPlanController/BillingOptions/BillingOptions.test.tsx:158:27
src/pages/PlanPage/subRoutes/UpgradePlanPage/UpgradeForm/Controllers/TeamPlanController/BillingOptions/BillingOptions.test.tsx > BillingOptions > when rendered > planString is set to annual plan > renders annual button as "selected"
Stack Traces | 0.184s run time
Error: expect(element).toHaveClass("bg-ds-primary-base")

Expected the element to have class:
  bg-ds-primary-base
Received:
  flex-1 py-1 px-2 text-sm cursor-pointer whitespace-nowrap disabled:text-ds-gray-quaternary disabled:border-ds-gray-tertiary disabled:bg-ds-gray-primary rounded-l
 ❯ .../TeamPlanController/BillingOptions/BillingOptions.test.tsx:141:27

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

Copy link

codecov bot commented Jan 21, 2025

Bundle Report

Bundle size has no change ✅

Copy link

codecov-public-qa bot commented Jan 21, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
4844 1 4843 0
View the top 1 failed tests by shortest run time
src/pages/PlanPage/subRoutes/UpgradePlanPage/UpgradeForm/Controllers/TeamPlanController/BillingOptions/BillingOptions.test.tsx > BillingOptions > when rendered > planString is set to annual plan > renders annual button as "selected"
Stack Traces | 0.184s run time
Error: expect(element).toHaveClass("bg-ds-primary-base")

Expected the element to have class:
  bg-ds-primary-base
Received:
  flex-1 py-1 px-2 text-sm cursor-pointer whitespace-nowrap disabled:text-ds-gray-quaternary disabled:border-ds-gray-tertiary disabled:bg-ds-gray-primary rounded-l
 ❯ .../TeamPlanController/BillingOptions/BillingOptions.test.tsx:141:27

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@codecov-releaser
Copy link
Contributor

✅ Deploy preview for gazebo ready!

Previews expire after 1 month automatically.

Storybook

Commit Created Cloud Enterprise
ccbd58f Tue, 21 Jan 2025 22:26:50 GMT Cloud Enterprise

Comment on lines +9 to +15
const renderWithTheme = (ui: React.ReactElement, theme: Theme) => {
return render(
<ThemeContext.Provider value={{ theme, setTheme: vi.fn() }}>
{ui}
</ThemeContext.Provider>
)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on converting this to a wrapper component, similar to how we do it in other tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[UI] Create Image Component To Automatically Handle Light & Dark Mode
3 participants