diff --git a/public/static/unassigned_bounty_hover_bg.svg b/public/static/unassigned_bounty_hover_bg.svg index 6e7f93ad..2c095236 100644 --- a/public/static/unassigned_bounty_hover_bg.svg +++ b/public/static/unassigned_bounty_hover_bg.svg @@ -1,7 +1,7 @@ - + diff --git a/src/people/utils/AssignedUnassignedBounties.tsx b/src/people/utils/AssignedUnassignedBounties.tsx index 2ec02198..6c5a418f 100644 --- a/src/people/utils/AssignedUnassignedBounties.tsx +++ b/src/people/utils/AssignedUnassignedBounties.tsx @@ -63,13 +63,10 @@ const DescriptionPriceContainer = styled.div` background-size: cover; :hover { - background: url('static/unassigned_bounty_hover_bg.svg'); + background: url('/static/unassigned_bounty_hover_bg.svg'); background-repeat: no-repeat; background-size: cover; } - :active { - background: url('static/unassigned_bounty_active_bg.svg'); - } `; const UnassignedPersonProfile = styled.div` @@ -204,7 +201,10 @@ const Bounties = (props: BountiesProps) => { ) : ( - + diff --git a/src/people/utils/__test__/AssignedUnassignedBounties.spec.tsx b/src/people/utils/__test__/AssignedUnassignedBounties.spec.tsx index be50f9e7..5377fdbc 100644 --- a/src/people/utils/__test__/AssignedUnassignedBounties.spec.tsx +++ b/src/people/utils/__test__/AssignedUnassignedBounties.spec.tsx @@ -1,6 +1,6 @@ import '@testing-library/jest-dom'; import { Router } from 'react-router-dom'; -import { queryByText, render, screen } from '@testing-library/react'; +import { render, screen, fireEvent } from '@testing-library/react'; import nock from 'nock'; import React from 'react'; import { setupStore } from '../../../__test__/__mockData__/setupStore'; @@ -32,6 +32,7 @@ beforeEach(() => { */ describe('Bounties Component', () => { nock(user.url).get('/person/id/1').reply(200, {}); + test('display bounty', () => { const bountyProps = { assignee: person, @@ -55,4 +56,37 @@ describe('Bounties Component', () => { ); expect(screen.queryByText(bountyProps.title)).toBeInTheDocument(); }); + + test('display bounty with hover effect on DescriptionPriceContainer', async () => { + const bountyProps = { + assignee: undefined, + price: 0, + sessionLength: '', + priceMin: 0, + priceMax: 0, + codingLanguage: [], + title: 'test_title', + person: person, + onPanelClick: () => {}, + widget: {}, + created: 0, + isPaid: false + }; + + render( + + + + ); + + const descriptionPriceContainer = screen.getByTestId('description-price-container'); + + expect(descriptionPriceContainer).toBeInTheDocument(); + + fireEvent.mouseEnter(descriptionPriceContainer); + + expect(descriptionPriceContainer).toHaveStyle({ + background: 'url("/static/unassigned_bounty_hover_bg.svg")' + }); + }); });