Skip to content

Commit

Permalink
fix(DFD-502): Update toggle active hover background color with coral … (
Browse files Browse the repository at this point in the history
#5094)

* fix(DFD-502): Update toggle active hover background color with coral tokens

* fix(): Update tests with mocked date

* fix(): Update tests with mocked date, again
  • Loading branch information
aamalric-talend authored Jan 2, 2024
1 parent f3cd46d commit 89f7250
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tasty-pots-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@talend/bootstrap-theme': minor
---

fix(DFD-502): Update toggle active hover background color with coral tokens
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import { render, screen } from '@testing-library/react';

import HeaderTitle from './HeaderTitle.component';

describe('HeaderTitle', () => {
beforeAll(() => {
jest.useFakeTimers().setSystemTime(new Date('2023-01-01'));
});

afterAll(() => {
jest.useRealTimers();
});

it('should render', () => {
// When
const { container } = render(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import MonthYearView from './MonthYearView.component';

describe('MonthYearView', () => {
it('should render', () => {
jest.useFakeTimers().setSystemTime(new Date('2023-01-01'));
// when
const { container } = render(
<MonthYearView
Expand All @@ -19,9 +20,11 @@ describe('MonthYearView', () => {

// then
expect(container.firstChild).toMatchSnapshot();
jest.useRealTimers();
});

it('should manage tabIndex', () => {
jest.useFakeTimers().setSystemTime(new Date('2023-01-01'));
// given
const { rerender } = render(
<MonthYearView
Expand All @@ -48,6 +51,7 @@ describe('MonthYearView', () => {

// then
expect(screen.getByLabelText('Switch to date-and-time view')).toHaveAttribute('tabIndex', '0');
jest.useRealTimers();
});

it('should trigger props.onBackClick', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/src/theme/_forms.switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ $switch-track-shadow-disabled: inset 2px 2px 7px 0 rgba(0, 0, 0, 0.2);

&:not(:disabled):hover {
+ *::before {
background: $lochmara600;
background: tokens.$coral-color-accent-background-strong-hover;
}
}
}
Expand Down

0 comments on commit 89f7250

Please sign in to comment.