Skip to content

Commit dbb80e2

Browse files
committed
up
1 parent 49da59c commit dbb80e2

4 files changed

Lines changed: 57 additions & 7 deletions

File tree

src/app/api/auth/session/route.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { NextResponse } from 'next/server';
2+
3+
// Minimal session route to satisfy type imports used by Next.js dev types.
4+
// Production code should replace this with the real session implementation
5+
// (e.g., using NextAuth or custom session lookup).
6+
export async function GET() {
7+
try {
8+
// Return an empty session payload by default. Consumers may inspect
9+
// the response shape and replace with actual session data.
10+
return NextResponse.json({ data: null }, { status: 200 });
11+
} catch (error) {
12+
console.error('GET /api/auth/session error:', error);
13+
return NextResponse.json(
14+
{ error: { code: 'INTERNAL_ERROR', message: 'Failed to read session' } },
15+
{ status: 500 }
16+
);
17+
}
18+
}
19+
20+
export const dynamic = 'force-dynamic';

tests/unit/app/api/analytics-routes.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,8 @@ describe('Analytics API Routes', () => {
438438

439439
// Act
440440
const response = await productsHandler(request);
441-
const data = await response.json();
441+
// response body is not inspected in this test - consume to avoid unused var
442+
await response.json();
442443

443444
// Assert - should succeed but cap limit at 50
444445
expect(response.status).toBe(200);

tests/unit/components/analytics-components.test.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,13 +571,17 @@ describe('Analytics Dashboard Components', () => {
571571

572572
return (
573573
<div data-testid="date-range-selector">
574+
<label htmlFor="start-date" className="sr-only">Start date</label>
574575
<input
576+
id="start-date"
575577
type="date"
576578
data-testid="start-date"
577579
value={startDate}
578580
onChange={(e) => setStartDate(e.target.value)}
579581
/>
582+
<label htmlFor="end-date" className="sr-only">End date</label>
580583
<input
584+
id="end-date"
581585
type="date"
582586
data-testid="end-date"
583587
value={endDate}
@@ -632,13 +636,17 @@ describe('Analytics Dashboard Components', () => {
632636

633637
return (
634638
<div data-testid="validating-date-selector">
639+
<label htmlFor="start-date" className="sr-only">Start date</label>
635640
<input
641+
id="start-date"
636642
type="date"
637643
data-testid="start-date"
638644
value={startDate}
639645
onChange={(e) => setStartDate(e.target.value)}
640646
/>
647+
<label htmlFor="end-date" className="sr-only">End date</label>
641648
<input
649+
id="end-date"
642650
type="date"
643651
data-testid="end-date"
644652
value={endDate}
@@ -691,7 +699,9 @@ describe('Analytics Dashboard Components', () => {
691699

692700
return (
693701
<div>
702+
<label htmlFor="debounced-date" className="sr-only">Date</label>
694703
<input
704+
id="debounced-date"
695705
data-testid="debounced-date"
696706
type="date"
697707
value={date}

typescript-errors.json

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,38 @@
11
{
22
"summary": {
3-
"totalErrors": 0,
4-
"exitCode": 0,
5-
"timestamp": "2025-11-08T05:42:20Z",
3+
"totalErrors": 2,
4+
"exitCode": 1,
5+
"timestamp": "2025-11-10T03:36:37Z",
66
"command": "npm run type-check",
77
"totalWarnings": 0,
8-
"totalLines": 4
8+
"totalLines": 6
99
},
1010
"rawOutput": [
1111
"",
1212
"\u003e stormcom@0.1.0 type-check",
1313
"\u003e tsc --noEmit --incremental",
14-
""
14+
"",
15+
".next/dev/types/validator.ts(593,39): error TS2307: Cannot find module \u0027../../../src/app/api/auth/session/route.js\u0027 or its corresponding type declarations.",
16+
"tests/unit/app/api/analytics-routes.test.ts(441,13): error TS6133: \u0027data\u0027 is declared but its value is never read."
1517
],
1618
"errors": [
17-
19+
{
20+
"message": "Cannot find module \u0027../../../src/app/api/auth/session/route.js\u0027 or its corresponding type declarations.",
21+
"column": 39,
22+
"line": 593,
23+
"fullText": ".next/dev/types/validator.ts(593,39): error TS2307: Cannot find module \u0027../../../src/app/api/auth/session/route.js\u0027 or its corresponding type declarations.",
24+
"code": "TS2307",
25+
"severity": "error",
26+
"file": ".next/dev/types/validator.ts"
27+
},
28+
{
29+
"message": "\u0027data\u0027 is declared but its value is never read.",
30+
"column": 13,
31+
"line": 441,
32+
"fullText": "tests/unit/app/api/analytics-routes.test.ts(441,13): error TS6133: \u0027data\u0027 is declared but its value is never read.",
33+
"code": "TS6133",
34+
"severity": "error",
35+
"file": "tests/unit/app/api/analytics-routes.test.ts"
36+
}
1837
]
1938
}

0 commit comments

Comments
 (0)