test(web): fix and complete Calendar/Sidebar render + interaction integration tests#1193
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request re-enables previously commented-out test cases for the Calendar Sidebar component and updates related test infrastructure. The changes focus on improving test coverage by activating existing test scenarios and modernizing test patterns.
- Uncommented and updated test cases for Sidebar rendering and interactions
- Updated mock data to use dynamic dates for test reliability
- Added necessary test setup (scroll mock, IntersectionObserver mock)
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
Sidebar.render.test.tsx |
Re-enabled tests for sidebar display with and without state, added scroll mock setup |
Sidebar.interactions.test.tsx |
Re-enabled interaction tests for opening/closing forms and adding someday events |
Calendar.render.test.tsx |
Added scroll mock to prevent console warnings during tests |
Calendar.form.test.tsx |
Added IntersectionObserver mock and re-enabled command palette test with keyboard shortcut fix |
events.misc.ts |
Updated EUROPE_TRIP dates to use current date for test stability |
jest.config.js |
Standardized test file pattern matching |
Comments suppressed due to low confidence (6)
packages/web/src/views/Calendar/Calendar.form.test.tsx:3
- Unused import fireEvent.
import { fireEvent, screen, waitFor, within } from "@testing-library/react";
packages/web/src/views/Calendar/Calendar.form.test.tsx:8
- Unused import viewSlice.
import { viewSlice } from "@web/ducks/events/slices/view.slice";
packages/web/src/views/Calendar/Calendar.form.test.tsx:9
- Unused import store.
import { store } from "@web/store";
packages/web/src/views/Calendar/components/Sidebar/Sidebar.render.test.tsx:2
- Unused import Provider.
import { Provider } from "react-redux";
packages/web/src/views/Calendar/components/Sidebar/Sidebar.render.test.tsx:3
- Unused import configureStore.
import { configureStore } from "@reduxjs/toolkit";
packages/web/src/views/Calendar/components/Sidebar/Sidebar.render.test.tsx:10
- Unused import rtlRender.
import {
render as rtlRender,
screen,
waitFor,
within,
} from "@testing-library/react";
packages/web/src/views/Calendar/components/Sidebar/Sidebar.render.test.tsx
Outdated
Show resolved
Hide resolved
packages/web/src/views/Calendar/components/Sidebar/Sidebar.render.test.tsx
Outdated
Show resolved
Hide resolved
packages/web/src/views/Calendar/components/Sidebar/Sidebar.render.test.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
tyler-dane
left a comment
There was a problem hiding this comment.
Thanks @BrainLeaked6628 , this is looking great! I tweaked a few things to minimize the console warnings. I'll be deploying this shortly and merge assuming all goes well
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
… instances (SwitchbackTech#1164) * Initial plan * fix(web): ensure someday recurring events edit only individual instances Co-authored-by: victor-enogwe <23452630+victor-enogwe@users.noreply.github.com> * refactor(web): remove redundant isSomeday variable in useSidebarActions Co-authored-by: victor-enogwe <23452630+victor-enogwe@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: victor-enogwe <23452630+victor-enogwe@users.noreply.github.com>
…for consistent test results

Fixes #1022
Problem
What I changed
Sidebar.render.test.tsx
Sidebar.interactions.test.tsx
Calendar.form.test.tsx (related stability for reminder feature)
Note
Completes Calendar/Sidebar integration tests, stabilizes mocks and dates, updates Jest matching, and ensures someday edits apply only to the targeted instance.
useSidebarActions.ts, forceapplyTo: THIS_EVENTfor someday edits (avoidALL_EVENTS), allowing per-instance customization.Calendar.form.test.tsx: Add mocks (IntersectionObserver, visibility), close-on-outside-click, trash delete flow, reminder focus via shortcut and command palette.Calendar.render.test.tsx: Mockscroll; assert single scroll call and key UI elements.Sidebar.render.test.tsx: Assert empty-state sections and preloaded someday event rendering.Sidebar.interactions.test.tsx: Open/close existing someday form; create/save new someday via "+" (MSW + mocked auth).instance.test.tsverifying only the targeted instance changes and base/others remain unchanged.events.misc.ts: MakeEUROPE_TRIPdates use local today to avoid timezone flakiness.jest.config.js(web project): BroadentestMatchtopackages/web/**/*.(test|spec).[jt]s?(x).Written by Cursor Bugbot for commit 6e664cc. This will update automatically on new commits. Configure here.