Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4d53887fcc | |||
| 673c151213 | |||
| 8b4f519e55 | |||
| f14e58d42c |
@@ -10,7 +10,7 @@
|
||||
"test": "DEBUG_PRINT_LIMIT=0 vitest run --reporter=dot --no-color",
|
||||
"test:all": "vitest run && npx playwright test",
|
||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
|
||||
"clean": "find src -name '*.js' -o -name '*.jsx' -delete"
|
||||
"clean": "find .. -not -path '*/node_modules/*' -not -name 'eslint.config.js' \\( -name '*.js' -o -name '*.jsx' \\) -delete"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tanstack/react-query": "^5.100.5",
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
import { describe, it, expect, vi, beforeAll, afterAll } from 'vitest';
|
||||
import { render, fireEvent } from '@testing-library/react';
|
||||
import '@testing-library/jest-dom';
|
||||
import { SessionList } from '../../../../src/components/stats/SessionList';
|
||||
|
||||
vi.mock('../../../../src/hooks/useSleepSession', () => ({
|
||||
useSessions: () => ({
|
||||
sessions: [
|
||||
{
|
||||
id: 1,
|
||||
start_time: '2026-06-04T11:58:00',
|
||||
end_time: '2026-06-04T13:58:00',
|
||||
notes: null,
|
||||
created_at: '2026-06-04T11:58:00',
|
||||
updated_at: '2026-06-04T11:58:00',
|
||||
},
|
||||
],
|
||||
isLoading: false,
|
||||
updateSession: vi.fn(),
|
||||
deleteSession: vi.fn(),
|
||||
isDeleting: false,
|
||||
}),
|
||||
}));
|
||||
|
||||
vi.mock('../../../../src/hooks/useSettings', () => ({
|
||||
useSettings: () => ({ settings: { sessionsPerPage: 10 } }),
|
||||
}));
|
||||
|
||||
const originalTZ = process.env.TZ;
|
||||
|
||||
beforeAll(() => {
|
||||
process.env.TZ = 'Europe/Stockholm';
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
process.env.TZ = originalTZ;
|
||||
});
|
||||
|
||||
describe('SessionList edit timezone', () => {
|
||||
it('pre-fills edit inputs with local Stockholm time, not UTC', () => {
|
||||
const { container } = render(<SessionList />);
|
||||
|
||||
const clickableRow = container.querySelector('.cursor-pointer') as HTMLElement;
|
||||
expect(clickableRow).not.toBeNull();
|
||||
fireEvent.click(clickableRow);
|
||||
|
||||
const inputs = container.querySelectorAll('input[type="datetime-local"]');
|
||||
expect(inputs).toHaveLength(2);
|
||||
|
||||
// Backend sends 11:58 UTC (no Z). Stockholm is UTC+2, so local time is 13:58.
|
||||
expect((inputs[0] as HTMLInputElement).value).toBe('2026-06-04T13:58');
|
||||
// Backend sends 13:58 UTC → Stockholm 15:58
|
||||
expect((inputs[1] as HTMLInputElement).value).toBe('2026-06-04T15:58');
|
||||
});
|
||||
});
|
||||
@@ -26,6 +26,7 @@ export default defineConfig({
|
||||
__APP_GITSHA__: JSON.stringify(APP_GITSHA),
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.tsx', '.ts', '.jsx', '.mjs', '.js', '.json'],
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Things I need to tell my AI to do
|
||||
|
||||
- [ ] Check so that all tests actually make sense, maybe some are now obsolete, and some are missing
|
||||
- [/backend start] Check so that all tests actually make sense, maybe some are now obsolete, and some are missing
|
||||
- [ ] Add a test coverage metric to both frontend and backend so that we can check how much of the code is tested. I would like >=90%
|
||||
- [ ] Go over Claude's slop-cleanup-stuff
|
||||
- [x] Update the "Sleep Sessions" by adding a fake pagination view in the frontend so that I don't have to scroll so much. Instead, I want to simply click "next" and "previous" (with like numbers in between like a google search)
|
||||
@@ -18,7 +18,7 @@ hint: Updates were rejected because the tag already exists in the remote.
|
||||
exitcode '1': failure
|
||||
```
|
||||
|
||||
- [ ] Editing a sleep session in "sleep sessions", when I click the edit button the times show up as UTC but should show as my local timezone
|
||||
- [x] Editing a sleep session in "sleep sessions", when I click the edit button the times show up as UTC but should show as my local timezone
|
||||
- [x] We should drop the "notes" column from the sleep_session table
|
||||
- [x] Switch over to oh-my-opencode and try it out
|
||||
- [x] Adda footer at the bottom of the app that shows the version (aka git tag) of the app
|
||||
|
||||
Reference in New Issue
Block a user