diff --git a/.claude/skills/commit.md b/.claude/skills/commit.md index 32810bc..9eaff50 100644 --- a/.claude/skills/commit.md +++ b/.claude/skills/commit.md @@ -20,6 +20,7 @@ When using Claude Code to commit changes: ## Examples ### Initial Commit + ```bash git add src/components/NewFeature.tsx make commit @@ -29,6 +30,7 @@ make commit ``` ### Amend Commit + ```bash git commit --amend # Edit the commit message to add: @@ -42,4 +44,4 @@ git commit --amend - Keep subject line under 50 characters - Use body to explain "why" not just "what" - Reference related issues if applicable -- Ensure commit passes linting and tests before pushing \ No newline at end of file +- Ensure commit passes linting and tests before pushing diff --git a/jest.js b/jest.js index ce9bb7e..644c048 100644 --- a/jest.js +++ b/jest.js @@ -5,13 +5,17 @@ jest.useFakeTimers(); jest.mock('zustand'); // Mocking Date -class MockDate extends Date { - constructor() { - super('2020-05-14T11:01:58.135'); // add whatever date you'll expect to get +const RealDate = Date; +class MockDate extends RealDate { + constructor(date) { + if (date) return new RealDate(date); + return new RealDate('2020-05-14T11:01:58.135Z'); } } +// @ts-ignore global.Date = MockDate; +Date.now = () => new RealDate('2020-05-14T11:01:58.135Z').getTime(); // Mocking Draft.js jest.mock('draft-js', () => ({ diff --git a/src/components/Window/__tests__/Windows.test.tsx b/src/components/Window/__tests__/Windows.test.tsx index 50b8908..9c2f197 100644 --- a/src/components/Window/__tests__/Windows.test.tsx +++ b/src/components/Window/__tests__/Windows.test.tsx @@ -1,24 +1,64 @@ import { fireEvent, render, screen } from '@testing-library/react'; +import '@testing-library/jest-dom'; import Window from '../Window'; -import { ProgramType } from '@processStore'; +import { ProgramType, processStore, WindowSize } from '@processStore'; +import React from 'react'; +import { act } from '@testing-library/react-hooks'; + +// Shared variable to capture props +let capturedDraggableProps: any; +let capturedResizableProps: any; + +// Mock DraggableProvider and ResizableBox to trigger callbacks and capture props +jest.mock('@providers', () => ({ + DraggableProvider: (props: any) => { + capturedDraggableProps = props; + return ( +
- x -
-+ x +
++ - +
++ o +
+- x -
++ x +
++ - +
++ o +
+- - -
+- o -
++ x +
++ - +
++ o +
+- x -
-+ x +
++ - +
++ o +
+- x -
-+ x +
++ - +
++ o +
+- x -
-+ x +
++ - +
++ o +
++ All iCloud +
++ 0 + + notes +
++ ποΈ +
++ No notes yet +
++ ποΈ +
++ Select or create a note +
- Title + All iCloud
- 14/05/2020 -
- -> - Description -
+ 3 + + notes+ Pinned +
++ Grocery List π +
++ 4/19/25 +
++ Milk, Eggs, Bread... +
++ April +
++ New Note +
++ 4/20/25 +
++ Teaching Holistic Health π§ββοΈ +
++ 4/20/25 +
++ Brainstorm for first in-class session... +
++ 4/20/2025 + + at + + 10:00 AM +
++ 2 + + words +
++ Aa +
++ Pinned +
++ Grocery List π +
++ 4/19/25 +
++ Milk, Eggs, Bread... +
++ April +
++ Teaching Holistic Health π§ββοΈ +
++ 4/20/25 +
++ Brainstorm for first in-class session... +
++ 4/19/2025 + + at + + 03:30 PM +
++ 3 + + words +
++ All iCloud +
++ 2 + + notes +
++ Aa +
++ 4/19/2025 + + at + + 03:30 PM +
++ 3 + + words +
+- Title + All iCloud
- 14/05/2020 -
- -> - Description -
+ 2 + + notes- Title + Aa
-
+
+ 4/20/2025 + + at + + 10:00 AM +
++ 219 + + words +
+