Skip to content

Commit 51b63f3

Browse files
rahmanunvergjulivan
authored andcommitted
test(calendar-web): update test for calendar
1 parent d701f26 commit 51b63f3

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

packages/pluggableWidgets/calendar-web/src/__tests__/Calendar.spec.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@ const defaultProps: CalendarContainerProps = {
2525
overflowY: "auto"
2626
};
2727

28+
beforeAll(() => {
29+
jest.useFakeTimers();
30+
jest.setSystemTime(new Date("2025-04-28T12:00:00Z"));
31+
});
32+
33+
afterAll(() => {
34+
jest.useRealTimers();
35+
});
36+
2837
describe("Calendar", () => {
2938
it("renders correctly with basic props", () => {
3039
const calendar = render(<Calendar {...defaultProps} />);

packages/pluggableWidgets/calendar-web/src/__tests__/__snapshots__/Calendar.spec.tsx.snap

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -617,10 +617,10 @@ exports[`Calendar renders correctly with basic props 1`] = `
617617
class="rbc-day-bg"
618618
/>
619619
<div
620-
class="rbc-day-bg"
620+
class="rbc-day-bg rbc-today"
621621
/>
622622
<div
623-
class="rbc-day-bg rbc-today"
623+
class="rbc-day-bg"
624624
/>
625625
<div
626626
class="rbc-day-bg"
@@ -654,7 +654,7 @@ exports[`Calendar renders correctly with basic props 1`] = `
654654
</button>
655655
</div>
656656
<div
657-
class="rbc-date-cell"
657+
class="rbc-date-cell rbc-now rbc-current"
658658
role="cell"
659659
>
660660
<button
@@ -665,7 +665,7 @@ exports[`Calendar renders correctly with basic props 1`] = `
665665
</button>
666666
</div>
667667
<div
668-
class="rbc-date-cell rbc-now rbc-current"
668+
class="rbc-date-cell"
669669
role="cell"
670670
>
671671
<button
@@ -1340,10 +1340,10 @@ exports[`Calendar renders correctly with basic props 1`] = `
13401340
class="rbc-day-bg"
13411341
/>
13421342
<div
1343-
class="rbc-day-bg"
1343+
class="rbc-day-bg rbc-today"
13441344
/>
13451345
<div
1346-
class="rbc-day-bg rbc-today"
1346+
class="rbc-day-bg"
13471347
/>
13481348
<div
13491349
class="rbc-day-bg"
@@ -1377,7 +1377,7 @@ exports[`Calendar renders correctly with basic props 1`] = `
13771377
</button>
13781378
</div>
13791379
<div
1380-
class="rbc-date-cell"
1380+
class="rbc-date-cell rbc-now rbc-current"
13811381
role="cell"
13821382
>
13831383
<button
@@ -1388,7 +1388,7 @@ exports[`Calendar renders correctly with basic props 1`] = `
13881388
</button>
13891389
</div>
13901390
<div
1391-
class="rbc-date-cell rbc-now rbc-current"
1391+
class="rbc-date-cell"
13921392
role="cell"
13931393
>
13941394
<button

0 commit comments

Comments
 (0)