From e0206d4fd4e98a7eef815126f16cc0fa0bf419c3 Mon Sep 17 00:00:00 2001 From: Shannon Anahata Date: Fri, 26 Sep 2025 12:40:43 -0700 Subject: [PATCH 1/4] adding a streak feature --- app/src/app/api/streak/route.ts | 126 ++ app/src/app/page.tsx | 43 +- app/src/components/StreakBanner.tsx | 106 ++ app/src/tests/StreakLogic.test.ts | 149 ++ app/test-results.junit.xml | 2177 +-------------------------- 5 files changed, 421 insertions(+), 2180 deletions(-) create mode 100644 app/src/app/api/streak/route.ts create mode 100644 app/src/components/StreakBanner.tsx create mode 100644 app/src/tests/StreakLogic.test.ts diff --git a/app/src/app/api/streak/route.ts b/app/src/app/api/streak/route.ts new file mode 100644 index 0000000..7d8fe30 --- /dev/null +++ b/app/src/app/api/streak/route.ts @@ -0,0 +1,126 @@ +import { NextRequest, NextResponse } from 'next/server'; +import { getServerSession } from 'next-auth/next'; +import { authOptions } from '@/lib/auth.config'; +import { PrismaClient } from '@prisma/client'; + +const prisma = new PrismaClient(); + +// GET: Calculate and return streak data +export async function GET() { + const session = await getServerSession(authOptions); + + if (!session?.user?.email) { + return NextResponse.json({ error: 'Unauthorized' }, { status: 401 }); + } + + const user = await prisma.user.findUnique({ + where: { email: session.user.email }, + }); + + if (!user) { + return NextResponse.json({ error: 'User not found' }, { status: 404 }); + } + + try { + // Get current week's activities + const now = new Date(); + const startOfWeek = new Date(now); + startOfWeek.setDate(now.getDate() - now.getDay()); // Start of current week (Sunday) + startOfWeek.setHours(0, 0, 0, 0); + + const endOfWeek = new Date(startOfWeek); + endOfWeek.setDate(startOfWeek.getDate() + 6); // End of current week (Saturday) + endOfWeek.setHours(23, 59, 59, 999); + + // Get activities for current week + const weekActivities = await prisma.activity.findMany({ + where: { + userId: user.id, + date: { + gte: startOfWeek, + lte: endOfWeek, + }, + }, + orderBy: { + date: 'asc', + }, + }); + + // Calculate unique days with activities this week + const uniqueDays = new Set(); + weekActivities.forEach(activity => { + const activityDate = new Date(activity.date); + const dateString = activityDate.toISOString().split('T')[0]; // YYYY-MM-DD format + uniqueDays.add(dateString); + }); + + const daysWithActivity = uniqueDays.size; + + // Calculate streak data + const streakData = { + currentWeek: { + daysWithActivity, + totalActivities: weekActivities.length, + totalDuration: weekActivities.reduce((sum, activity) => sum + activity.duration, 0), + totalCalories: weekActivities.reduce((sum, activity) => sum + (activity.calories || 0), 0), + hasStreak: daysWithActivity >= 4, // Streak threshold: 4+ days + streakMessage: daysWithActivity >= 4 + ? `🔥 Amazing! You've worked out ${daysWithActivity} days this week!` + : daysWithActivity >= 2 + ? `💪 Great progress! You've worked out ${daysWithActivity} days this week. Keep it up!` + : daysWithActivity >= 1 + ? `🎯 Good start! You've worked out ${daysWithActivity} day this week.` + : `🚀 Ready to start your fitness journey? Log your first activity!`, + activitiesByDay: weekActivities.reduce((acc, activity) => { + const dateString = new Date(activity.date).toISOString().split('T')[0]; + if (!acc[dateString]) { + acc[dateString] = []; + } + acc[dateString].push(activity); + return acc; + }, {} as Record), + }, + // Calculate last week for comparison + lastWeek: await calculateLastWeekStreak(user.id, startOfWeek), + }; + + return NextResponse.json({ streak: streakData }); + } catch (error) { + console.error('Error calculating streak:', error); + return NextResponse.json({ error: 'Failed to calculate streak' }, { status: 500 }); + } +} + +// Helper function to calculate last week's streak +async function calculateLastWeekStreak(userId: string, currentWeekStart: Date) { + const lastWeekStart = new Date(currentWeekStart); + lastWeekStart.setDate(currentWeekStart.getDate() - 7); + + const lastWeekEnd = new Date(lastWeekStart); + lastWeekEnd.setDate(lastWeekStart.getDate() + 6); + lastWeekEnd.setHours(23, 59, 59, 999); + + const lastWeekActivities = await prisma.activity.findMany({ + where: { + userId, + date: { + gte: lastWeekStart, + lte: lastWeekEnd, + }, + }, + }); + + const uniqueDays = new Set(); + lastWeekActivities.forEach(activity => { + const activityDate = new Date(activity.date); + const dateString = activityDate.toISOString().split('T')[0]; + uniqueDays.add(dateString); + }); + + return { + daysWithActivity: uniqueDays.size, + totalActivities: lastWeekActivities.length, + totalDuration: lastWeekActivities.reduce((sum, activity) => sum + activity.duration, 0), + totalCalories: lastWeekActivities.reduce((sum, activity) => sum + (activity.calories || 0), 0), + }; +} diff --git a/app/src/app/page.tsx b/app/src/app/page.tsx index 04eff46..64ccd8b 100644 --- a/app/src/app/page.tsx +++ b/app/src/app/page.tsx @@ -6,6 +6,7 @@ import Card from "@/components/Card"; import Link from "next/link"; import Button from "@/components/Button"; import Logo from "@/components/Logo"; +import StreakBanner from "@/components/StreakBanner"; import { Line, Bar } from "react-chartjs-2"; import { Chart as ChartJS, @@ -79,20 +80,21 @@ interface DashboardData { }; } -interface DashboardData { - thisWeek: { - totalCalories: number; - avgDailyCalories: number; - totalDuration: number; +interface StreakData { + currentWeek: { daysWithActivity: number; - daily: DailyStats[]; + totalActivities: number; + totalDuration: number; + totalCalories: number; + hasStreak: boolean; + streakMessage: string; + activitiesByDay: Record; }; lastWeek: { - totalCalories: number; - avgDailyCalories: number; - totalDuration: number; daysWithActivity: number; - daily: DailyStats[]; + totalActivities: number; + totalDuration: number; + totalCalories: number; }; } @@ -100,6 +102,7 @@ export default function HomePage() { const [activities, setActivities] = useState([]); const [meals, setMeals] = useState([]); const [dashboardData, setDashboardData] = useState(null); + const [streakData, setStreakData] = useState(null); const [loading, setLoading] = useState(false); const [isAuthenticated, setIsAuthenticated] = useState(null); const [activeChart, setActiveChart] = useState<'activity' | 'burned' | 'consumed'>('activity'); @@ -165,10 +168,11 @@ export default function HomePage() { async function fetchData() { setLoading(true); try { - const [activitiesRes, mealsRes, dashboardRes] = await Promise.all([ + const [activitiesRes, mealsRes, dashboardRes, streakRes] = await Promise.all([ fetch("/api/activities", { credentials: 'include' }), fetch("/api/meals", { credentials: 'include' }), fetch("/api/dashboard", { credentials: 'include' }), + fetch("/api/streak", { credentials: 'include' }), ]); if (activitiesRes.ok) { @@ -197,6 +201,11 @@ export default function HomePage() { const data = await dashboardRes.json(); setDashboardData(data); } + + if (streakRes.ok) { + const data = await streakRes.json(); + setStreakData(data.streak); + } } catch (error) { console.error('Error fetching data:', error); } finally { @@ -469,6 +478,18 @@ export default function HomePage() { {/* Dashboard - Only show when authenticated */} {isAuthenticated && ( <> + {/* Streak Banner */} + {streakData && ( + + )} + {/* Summary Stats */}

diff --git a/app/src/components/StreakBanner.tsx b/app/src/components/StreakBanner.tsx new file mode 100644 index 0000000..e149e0d --- /dev/null +++ b/app/src/components/StreakBanner.tsx @@ -0,0 +1,106 @@ +import React from 'react'; +import { FireIcon, TrophyIcon, StarIcon } from '@heroicons/react/24/solid'; + +interface StreakBannerProps { + daysWithActivity: number; + streakMessage: string; + hasStreak: boolean; + totalActivities: number; + totalDuration: number; + totalCalories: number; +} + +export default function StreakBanner({ + daysWithActivity, + streakMessage, + hasStreak, + totalActivities, + totalDuration, + totalCalories, +}: StreakBannerProps) { + // Don't show banner if no activities + if (daysWithActivity === 0) { + return null; + } + + // Determine banner style based on streak level + const getBannerStyle = () => { + if (hasStreak) { + return { + container: 'bg-gradient-to-r from-orange-500 to-red-500 text-white', + icon: 'text-yellow-300', + glow: 'shadow-lg shadow-orange-500/25', + }; + } else if (daysWithActivity >= 2) { + return { + container: 'bg-gradient-to-r from-blue-500 to-purple-500 text-white', + icon: 'text-blue-200', + glow: 'shadow-lg shadow-blue-500/25', + }; + } else { + return { + container: 'bg-gradient-to-r from-green-500 to-teal-500 text-white', + icon: 'text-green-200', + glow: 'shadow-lg shadow-green-500/25', + }; + } + }; + + const getIcon = () => { + if (hasStreak) { + return ; + } else if (daysWithActivity >= 2) { + return ; + } else { + return ; + } + }; + + const bannerStyle = getBannerStyle(); + + return ( +
+
+
+
+ {getIcon()} +
+
+

+ {streakMessage} +

+
+ {totalActivities} activities + {totalDuration} minutes + {totalCalories} calories burned +
+
+
+ + {hasStreak && ( +
+
+ {daysWithActivity} +
+
+ days this week +
+
+ )} +
+ + {hasStreak && ( +
+
+ + STREAK ACHIEVED! + +
+

+ You're on fire! Keep up the amazing work! 🔥 +

+
+ )} +
+ ); +} diff --git a/app/src/tests/StreakLogic.test.ts b/app/src/tests/StreakLogic.test.ts new file mode 100644 index 0000000..03d0c3f --- /dev/null +++ b/app/src/tests/StreakLogic.test.ts @@ -0,0 +1,149 @@ +// Test the streak calculation logic +describe('Streak Logic', () => { + // Mock activity data for testing + const createMockActivity = (date: string, type: string = 'running') => ({ + id: Math.random().toString(), + type, + date: new Date(date), + duration: 30, + calories: 300, + }); + + const calculateStreak = (activities: any[]) => { + // Group activities by date + const activitiesByDate = new Map(); + activities.forEach(activity => { + const dateString = new Date(activity.date).toISOString().split('T')[0]; + if (!activitiesByDate.has(dateString)) { + activitiesByDate.set(dateString, []); + } + activitiesByDate.get(dateString).push(activity); + }); + + const daysWithActivity = activitiesByDate.size; + const totalActivities = activities.length; + const totalDuration = activities.reduce((sum, activity) => sum + activity.duration, 0); + const totalCalories = activities.reduce((sum, activity) => sum + (activity.calories || 0), 0); + const hasStreak = daysWithActivity >= 4; + + let streakMessage = ''; + if (hasStreak) { + streakMessage = `🔥 Amazing! You've worked out ${daysWithActivity} days this week!`; + } else if (daysWithActivity >= 2) { + streakMessage = `💪 Great progress! You've worked out ${daysWithActivity} days this week. Keep it up!`; + } else if (daysWithActivity >= 1) { + streakMessage = `🎯 Good start! You've worked out ${daysWithActivity} day this week.`; + } else { + streakMessage = `🚀 Ready to start your fitness journey? Log your first activity!`; + } + + return { + daysWithActivity, + totalActivities, + totalDuration, + totalCalories, + hasStreak, + streakMessage, + }; + }; + + it('should calculate streak correctly for 5 days (streak achieved)', () => { + const activities = [ + createMockActivity('2024-01-15T10:00:00Z'), + createMockActivity('2024-01-16T10:00:00Z'), + createMockActivity('2024-01-17T10:00:00Z'), + createMockActivity('2024-01-18T10:00:00Z'), + createMockActivity('2024-01-19T10:00:00Z'), + ]; + + const result = calculateStreak(activities); + + expect(result.daysWithActivity).toBe(5); + expect(result.hasStreak).toBe(true); + expect(result.totalActivities).toBe(5); + expect(result.totalDuration).toBe(150); // 5 * 30 minutes + expect(result.totalCalories).toBe(1500); // 5 * 300 calories + expect(result.streakMessage).toContain('Amazing!'); + expect(result.streakMessage).toContain('5 days'); + }); + + it('should calculate streak correctly for 3 days (no streak)', () => { + const activities = [ + createMockActivity('2024-01-15T10:00:00Z'), + createMockActivity('2024-01-16T10:00:00Z'), + createMockActivity('2024-01-17T10:00:00Z'), + ]; + + const result = calculateStreak(activities); + + expect(result.daysWithActivity).toBe(3); + expect(result.hasStreak).toBe(false); + expect(result.totalActivities).toBe(3); + expect(result.totalDuration).toBe(90); // 3 * 30 minutes + expect(result.totalCalories).toBe(900); // 3 * 300 calories + expect(result.streakMessage).toContain('Great progress'); + expect(result.streakMessage).toContain('3 days'); + }); + + it('should calculate streak correctly for 1 day', () => { + const activities = [ + createMockActivity('2024-01-15T10:00:00Z'), + ]; + + const result = calculateStreak(activities); + + expect(result.daysWithActivity).toBe(1); + expect(result.hasStreak).toBe(false); + expect(result.totalActivities).toBe(1); + expect(result.totalDuration).toBe(30); + expect(result.totalCalories).toBe(300); + expect(result.streakMessage).toContain('Good start'); + expect(result.streakMessage).toContain('1 day'); + }); + + it('should calculate streak correctly for 0 days', () => { + const activities: any[] = []; + + const result = calculateStreak(activities); + + expect(result.daysWithActivity).toBe(0); + expect(result.hasStreak).toBe(false); + expect(result.totalActivities).toBe(0); + expect(result.totalDuration).toBe(0); + expect(result.totalCalories).toBe(0); + expect(result.streakMessage).toContain('Ready to start'); + }); + + it('should handle multiple activities on the same day', () => { + const activities = [ + createMockActivity('2024-01-15T10:00:00Z', 'running'), + createMockActivity('2024-01-15T18:00:00Z', 'cycling'), // Same day + createMockActivity('2024-01-16T10:00:00Z', 'weightlifting'), + createMockActivity('2024-01-17T10:00:00Z', 'yoga'), + createMockActivity('2024-01-18T10:00:00Z', 'swimming'), + ]; + + const result = calculateStreak(activities); + + expect(result.daysWithActivity).toBe(4); // Should count as 4 unique days + expect(result.hasStreak).toBe(true); // 4 days = streak achieved + expect(result.totalActivities).toBe(5); // Total activities + expect(result.totalDuration).toBe(150); // 5 * 30 minutes + expect(result.totalCalories).toBe(1500); // 5 * 300 calories + }); + + it('should handle exactly 4 days (streak threshold)', () => { + const activities = [ + createMockActivity('2024-01-15T10:00:00Z'), + createMockActivity('2024-01-16T10:00:00Z'), + createMockActivity('2024-01-17T10:00:00Z'), + createMockActivity('2024-01-18T10:00:00Z'), + ]; + + const result = calculateStreak(activities); + + expect(result.daysWithActivity).toBe(4); + expect(result.hasStreak).toBe(true); // Exactly 4 days should trigger streak + expect(result.streakMessage).toContain('Amazing!'); + }); +}); diff --git a/app/test-results.junit.xml b/app/test-results.junit.xml index 83b02aa..23ea9c4 100644 --- a/app/test-results.junit.xml +++ b/app/test-results.junit.xml @@ -1,2178 +1,17 @@ - - - + + + - + - + - - - - - - - - Error: expect(received).toBe(expected) // Object.is equality - -Expected: true -Received: false - at Object.toBe (/Users/shannonanahata/fitfest/app/src/tests/FlakyTestExample.test.tsx:26:25) - at processTicksAndRejections (node:internal/process/task_queues:105:5) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Error: expect(received).toBe(expected) // Object.is equality - -Expected: 5 -Received: 4 - at Object.toBe (/Users/shannonanahata/fitfest/app/src/tests/SentryTestAnalytics.test.tsx:20:22) - at Promise.then.completed (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:298:28) - at new Promise (<anonymous>) - at callAsyncCircusFn (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:231:10) - at _callCircusTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:316:40) - at processTicksAndRejections (node:internal/process/task_queues:105:5) - at _runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:252:3) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:126:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at run (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:71:3) - at runAndTransformResultsToJestFormat (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) - at jestAdapter (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) - at runTestInternal (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:367:16) - at runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:444:34) - at Object.worker (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/testWorker.js:106:12) - - - TestingLibraryElementError: Unable to find an element with the text: Non-existent Button. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. - -Ignored nodes: comments, script, style -<body> - <div> - <button - class="bg-fitfest-deep text-white px-4 py-2 rounded hover:bg-fitfest-bright dark:bg-fitfest-bright dark:hover:bg-fitfest-deep transition-colors disabled:opacity-50 shadow-sm " - > - Test Button - </button> - </div> -</body> - at Object.getElementError (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/config.js:37:19) - at /Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:76:38 - at /Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:52:17 - at /Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:95:19 - at Object.getByText (/Users/shannonanahata/fitfest/app/src/tests/SentryTestAnalytics.test.tsx:26:21) - at Promise.then.completed (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:298:28) - at new Promise (<anonymous>) - at callAsyncCircusFn (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:231:10) - at _callCircusTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:316:40) - at processTicksAndRejections (node:internal/process/task_queues:105:5) - at _runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:252:3) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:126:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at run (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:71:3) - at runAndTransformResultsToJestFormat (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) - at jestAdapter (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) - at runTestInternal (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:367:16) - at runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:444:34) - at Object.worker (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/testWorker.js:106:12) - - - Error: expect(received).toBe(expected) // Object.is equality - -Expected: "42" -Received: 42 - at Object.toBe (/Users/shannonanahata/fitfest/app/src/tests/SentryTestAnalytics.test.tsx:31:22) - at Promise.then.completed (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:298:28) - at new Promise (<anonymous>) - at callAsyncCircusFn (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:231:10) - at _callCircusTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:316:40) - at processTicksAndRejections (node:internal/process/task_queues:105:5) - at _runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:252:3) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:126:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at run (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:71:3) - at runAndTransformResultsToJestFormat (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) - at jestAdapter (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) - at runTestInternal (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:367:16) - at runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:444:34) - at Object.worker (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/testWorker.js:106:12) - - - TypeError: Cannot read properties of null (reading 'someProperty') - at Object.someProperty (/Users/shannonanahata/fitfest/app/src/tests/SentryTestAnalytics.test.tsx:37:18) - at Promise.then.completed (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:298:28) - at new Promise (<anonymous>) - at callAsyncCircusFn (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:231:10) - at _callCircusTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:316:40) - at processTicksAndRejections (node:internal/process/task_queues:105:5) - at _runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:252:3) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:126:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at run (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:71:3) - at runAndTransformResultsToJestFormat (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) - at jestAdapter (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) - at runTestInternal (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:367:16) - at runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:444:34) - at Object.worker (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/testWorker.js:106:12) - - - Error: expect(received).toHaveLength(expected) - -Expected length: 5 -Received length: 3 -Received array: [1, 2, 3] - at Object.toHaveLength (/Users/shannonanahata/fitfest/app/src/tests/SentryTestAnalytics.test.tsx:42:21) - at Promise.then.completed (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:298:28) - at new Promise (<anonymous>) - at callAsyncCircusFn (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:231:10) - at _callCircusTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:316:40) - at processTicksAndRejections (node:internal/process/task_queues:105:5) - at _runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:252:3) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:126:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at run (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:71:3) - at runAndTransformResultsToJestFormat (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) - at jestAdapter (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) - at runTestInternal (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:367:16) - at runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:444:34) - at Object.worker (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/testWorker.js:106:12) - - - Error: expect(received).toBe(expected) // Object.is equality - -Expected: true -Received: false - at Object.toBe (/Users/shannonanahata/fitfest/app/src/tests/SentryTestAnalytics.test.tsx:56:27) - at processTicksAndRejections (node:internal/process/task_queues:105:5) - - - TypeError: Cannot read properties of undefined (reading 'targetCalories') - at Object.targetCalories (/Users/shannonanahata/fitfest/app/src/tests/SentryTestAnalytics.test.tsx:67:27) - at processTicksAndRejections (node:internal/process/task_queues:105:5) - - - Error: thrown: "Exceeded timeout of 1000 ms for a test. -Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout." - at it (/Users/shannonanahata/fitfest/app/src/tests/SentryTestAnalytics.test.tsx:70:5) - at _dispatchDescribe (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/index.js:91:26) - at describe (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/index.js:55:5) - at describe (/Users/shannonanahata/fitfest/app/src/tests/SentryTestAnalytics.test.tsx:46:3) - at _dispatchDescribe (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/index.js:91:26) - at describe (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/index.js:55:5) - at Object.describe (/Users/shannonanahata/fitfest/app/src/tests/SentryTestAnalytics.test.tsx:15:1) - at Runtime._execModule (/Users/shannonanahata/fitfest/app/node_modules/jest-runtime/build/index.js:1439:24) - at Runtime._loadModule (/Users/shannonanahata/fitfest/app/node_modules/jest-runtime/build/index.js:1022:12) - at Runtime.requireModule (/Users/shannonanahata/fitfest/app/node_modules/jest-runtime/build/index.js:882:12) - at jestAdapter (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13) - at processTicksAndRejections (node:internal/process/task_queues:105:5) - at runTestInternal (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:367:16) - at runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:444:34) - at Object.worker (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/testWorker.js:106:12) - - - Error: expect(received).toBeGreaterThan(expected) - -Expected: > 0.1 -Received: 0.09144515182681223 - at Object.toBeGreaterThan (/Users/shannonanahata/fitfest/app/src/tests/SentryTestAnalytics.test.tsx:91:22) - at Promise.then.completed (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:298:28) - at new Promise (<anonymous>) - at callAsyncCircusFn (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:231:10) - at _callCircusTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:316:40) - at _runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:252:3) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:126:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at run (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:71:3) - at runAndTransformResultsToJestFormat (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) - at jestAdapter (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) - at runTestInternal (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:367:16) - at runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:444:34) - at Object.worker (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/testWorker.js:106:12) - - - - - - - - - - - TestingLibraryElementError: Found multiple elements with the text: Test - -Here are the matching elements: - -Ignored nodes: comments, script, style -<div - id="test-element" -> - Test -</div> - -Ignored nodes: comments, script, style -<button - class="bg-fitfest-deep text-white px-4 py-2 rounded hover:bg-fitfest-bright dark:bg-fitfest-bright dark:hover:bg-fitfest-deep transition-colors disabled:opacity-50 shadow-sm " -> - Test -</button> - -(If this is intentional, then use the `*AllBy*` variant of the query (like `queryAllByText`, `getAllByText`, or `findAllByText`)). - -Ignored nodes: comments, script, style -<body> - <div - id="test-element" - > - Test - </div> - <div> - <button - class="bg-fitfest-deep text-white px-4 py-2 rounded hover:bg-fitfest-bright dark:bg-fitfest-bright dark:hover:bg-fitfest-deep transition-colors disabled:opacity-50 shadow-sm " - > - Test - </button> - </div> -</body> - at Object.getElementError (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/config.js:37:19) - at getElementError (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:20:35) - at getMultipleElementsFoundError (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:23:10) - at /Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:55:13 - at /Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/query-helpers.js:95:19 - at Object.getByText (/Users/shannonanahata/fitfest/app/src/tests/SentryTestAnalytics.test.tsx:155:29) - at Promise.then.completed (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:298:28) - at new Promise (<anonymous>) - at callAsyncCircusFn (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:231:10) - at _callCircusTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:316:40) - at _runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:252:3) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:126:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at run (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:71:3) - at runAndTransformResultsToJestFormat (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) - at jestAdapter (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) - at runTestInternal (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:367:16) - at runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:444:34) - at Object.worker (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/testWorker.js:106:12) - - - - - - - - - - - Error: expect(received).toBe(expected) // Object.is equality - -Expected: "different" -Received: "password123" - at Object.toBe (/Users/shannonanahata/fitfest/app/src/tests/SentryTestAnalytics.test.tsx:235:33) - at Promise.then.completed (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:298:28) - at new Promise (<anonymous>) - at callAsyncCircusFn (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:231:10) - at _callCircusTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:316:40) - at _runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:252:3) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:126:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at run (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:71:3) - at runAndTransformResultsToJestFormat (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) - at jestAdapter (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) - at runTestInternal (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:367:16) - at runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:444:34) - at Object.worker (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/testWorker.js:106:12) - - - - - Error: expect(received).toBeLessThan(expected) - -Expected: < 1000 -Received: 2001 - at Object.toBeLessThan (/Users/shannonanahata/fitfest/app/src/tests/SentryTestAnalytics.test.tsx:261:22) - - - - - Error: expect(received).toBe(expected) // Object.is equality - -Expected: true -Received: false - at Object.toBe (/Users/shannonanahata/fitfest/app/src/tests/SentryTestAnalytics.test.tsx:309:30) - - - TypeError: Cannot read properties of undefined (reading 'ok') - at ok (/Users/shannonanahata/fitfest/app/src/tests/SentryTestAnalytics.test.tsx:328:57) - at Array.filter (<anonymous>) - at Object.filter (/Users/shannonanahata/fitfest/app/src/tests/SentryTestAnalytics.test.tsx:328:43) - - - - - - - - - - - - - - - - - - - Error: expect(jest.fn()).toHaveBeenCalledWith(...expected) - -Expected: "/api/meals", {"body": "{\"name\":\"Chicken Salad\",\"type\":\"lunch\",\"date\":{\"inverse\":false},\"calories\":\"350\",\"protein\":\"\",\"carbs\":\"\",\"fat\":\"\"}", "headers": {"Content-Type": "application/json"}, "method": "POST"} -Received - 1 - "/api/auth/session", - Object { - - "body": "{\"name\":\"Chicken Salad\",\"type\":\"lunch\",\"date\":{\"inverse\":false},\"calories\":\"350\",\"protein\":\"\",\"carbs\":\"\",\"fat\":\"\"}", - + "credentials": "include", - "headers": Object { - - "Content-Type": "application/json", - + "Cache-Control": "no-cache", - }, - - "method": "POST", - }, - 2 - "/api/meals", - Object { - - "body": "{\"name\":\"Chicken Salad\",\"type\":\"lunch\",\"date\":{\"inverse\":false},\"calories\":\"350\",\"protein\":\"\",\"carbs\":\"\",\"fat\":\"\"}", - + "body": "{\"name\":\"Chicken Salad\",\"type\":\"lunch\",\"date\":\"2025-09-26\",\"calories\":\"350\",\"protein\":null,\"carbs\":null,\"fat\":null}", - "headers": Object { - "Content-Type": "application/json", - }, - "method": "POST", - }, - -Number of calls: 2 - -Ignored nodes: comments, script, style -<html> - <head /> - <body> - <div> - <div - class="min-h-screen bg-gray-50 dark:bg-fitfest-dark transition-colors duration-200" - > - <div - class="bg-white dark:bg-fitfest-dark-secondary shadow-sm border-b border-fitfest-subtle/20 dark:border-fitfest-subtle/10 transition-colors duration-200" - > - <div - class="flex items-center justify-between p-4" - > - <div - class="flex items-center gap-3" - > - <button - class="p-2 hover:bg-gray-100 dark:hover:bg-fitfest-dark-tertiary rounded-full transition-colors duration-200" - > - <svg - aria-hidden="true" - class="w-5 h-5 text-gray-600 dark:text-fitfest-subtle" - data-slot="icon" - fill="none" - stroke="currentColor" - stroke-width="1.5" - viewBox="0 0 24 24" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18" - stroke-linecap="round" - stroke-linejoin="round" - /> - </svg> - </button> - <div - class="flex items-center gap-2" - > - <span - class="text-2xl" - > - 🥗 - </span> - <h1 - class="text-xl font-bold text-gray-900 dark:text-fitfest-subtle" - > - Log - Lunch - </h1> - </div> - </div> - </div> - </div> - <div - class="max-w-md mx-auto mt-8 px-4" - > - <form - class="bg-white dark:bg-fitfest-dark-secondary rounded-lg shadow-sm p-6 space-y-4 transition-colors duration-200" - > - <div> - <label - class="block text-sm font-medium text-gray-700 dark:text-fitfest-subtle mb-1" - for="date" - > - Date - </label> - <input - class="w-full px-3 py-2 border border-gray-300 dark:border-fitfest-subtle/20 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-fitfest-dark-tertiary text-gray-900 dark:text-fitfest-subtle transition-colors duration-200" - id="date" - name="date" - required="" - type="date" - value="2025-09-26" - /> - </div> - <div> - <label - class="block text-sm font-medium text-gray-700 dark:text-fitfest-subtle mb-1" - for="name" - > - Meal Name - </label> - <input - class="w-full px-3 py-2 border border-gray-300 dark:border-fitfest-subtle/20 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-fitfest-dark-tertiary text-gray-900 dark:text-fitfest-subtle placeholder-gray-500 dark:placeholder-fitfest-subtle/50 transition-colors duration-200" - id="name" - name="name" - placeholder="e.g., Oatmeal with berries" - required="" - type="text" - value="Chicken Salad" - /> - </div> - <div> - <label - class="block text-sm font-medium text-gray-700 dark:text-fitfest-subtle mb-1" - for="calories" - > - Calories - </label> - <input - class="w-full px-3 py-2 border border-gray-300 dark:border-fitfest-subtle/20 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-fitfest-dark-tertiary text-gray-900 dark:text-fitfest-subtle placeholder-gray-500 dark:placeholder-fitfest-subtle/50 transition-colors duration-200" - id="calories" - min="0" - name="calories" - placeholder="e.g., 300" - required="" - type="number" - value="350" - /> - </div> - <div - class="grid grid-cols-3 gap-3" - > - <div> - <label - class="block text-sm font-medium text-gray-700 dark:text-fitfest-subtle mb-1" - for="protein" - > - Protein (g) - </label> - <input - class="w-full px-3 py-2 border border-gray-300 dark:border-fitfest-subtle/20 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-fitfest-dark-tertiary text-gray-900 dark:text-fitfest-subtle placeholder-gray-500 dark:placeholder-fitfest-subtle/50 transition-colors duration-200" - id="protein" - min="0" - name="protein" - placeholder="0" - step="0.1" - type="number" - value="" - /> - </div> - <div> - <label - class="block text-sm font-medium text-gray-700 dark:text-fitfest-subtle mb-1" - for="carbs" - > - Carbs (g) - </label> - <input - class="w-full px-3 py-2 border border-gray-300 dark:border-fitfest-subtle/20 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-fitfest-dark-tertiary text-gray-900 dark:text-fitfest-subtle placeholder-gray-500 dark:placeholder-fitfest-subtle/50 transition-colors duration-200" - id="carbs" - min="0" - name="carbs" - placeholder="0" - step="0.1" - type="number" - value="" - /> - </div> - <div> - <label - class="block text-sm font-medium text-gray-700 dark:text-fitfest-subtle mb-1" - for="fat" - > - Fat (g) - </label> - <input - class="w-full px-3 py-2 border border-gray-300 dark:border-fitfest-subtle/20 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-fitfest-dark-tertiary text-gray-900 dark:text-fitfest-subtle placeholder-gray-500 dark:placeholder-fitfest-subtle/50 transition-colors duration-200" - id="fat" - min="0" - name="fat" - placeholder="0" - step="0.1" - type="number" - value="" - /> - </div> - </div> - <div - class="flex gap-3 pt-4" - > - <button - class="flex-1 px-4 py-2 text-gray-700 dark:text-fitfest-subtle bg-gray-100 dark:bg-fitfest-dark-tertiary border border-gray-300 dark:border-fitfest-subtle/20 rounded-md hover:bg-gray-200 dark:hover:bg-fitfest-dark-tertiary/80 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:border-transparent transition-colors duration-200" - type="button" - > - Cancel - </button> - <button - class="flex-1 px-4 py-2 text-white bg-blue-600 border border-transparent rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed" - type="submit" - > - Save Meal - </button> - </div> - </form> - </div> - </div> - </div> - </body> -</html> - at toHaveBeenCalledWith (/Users/shannonanahata/fitfest/app/src/tests/MealLogForm.test.tsx:156:23) - at runWithExpensiveErrorDiagnosticsDisabled (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/config.js:47:12) - at checkCallback (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait-for.js:124:77) - at checkRealTimersCallback (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait-for.js:118:16) - at Timeout.task [as _onTimeout] (/Users/shannonanahata/fitfest/app/node_modules/jsdom/lib/jsdom/browser/Window.js:520:19) - at listOnTimeout (node:internal/timers:611:17) - at processTimers (node:internal/timers:546:7) - - - - - - - - - - - - - - - - - Error: Form validation too strict for short names - -Ignored nodes: comments, script, style -<html> - <head /> - <body> - <div> - <div - class="min-h-screen bg-gray-50 dark:bg-fitfest-dark transition-colors duration-200" - > - <div - class="bg-white dark:bg-fitfest-dark-secondary shadow-sm border-b border-fitfest-subtle/20 dark:border-fitfest-subtle/10 transition-colors duration-200" - > - <div - class="flex items-center justify-between p-4" - > - <div - class="flex items-center gap-3" - > - <button - class="p-2 hover:bg-gray-100 dark:hover:bg-fitfest-dark-tertiary rounded-full transition-colors duration-200" - > - <svg - aria-hidden="true" - class="w-5 h-5 text-gray-600 dark:text-fitfest-subtle" - data-slot="icon" - fill="none" - stroke="currentColor" - stroke-width="1.5" - viewBox="0 0 24 24" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18" - stroke-linecap="round" - stroke-linejoin="round" - /> - </svg> - </button> - <div - class="flex items-center gap-2" - > - <span - class="text-2xl" - > - 🥗 - </span> - <h1 - class="text-xl font-bold text-gray-900 dark:text-fitfest-subtle" - > - Log - Lunch - </h1> - </div> - </div> - </div> - </div> - <div - class="max-w-md mx-auto mt-8 px-4" - > - <form - class="bg-white dark:bg-fitfest-dark-secondary rounded-lg shadow-sm p-6 space-y-4 transition-colors duration-200" - > - <div> - <label - class="block text-sm font-medium text-gray-700 dark:text-fitfest-subtle mb-1" - for="date" - > - Date - </label> - <input - class="w-full px-3 py-2 border border-gray-300 dark:border-fitfest-subtle/20 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-fitfest-dark-tertiary text-gray-900 dark:text-fitfest-subtle transition-colors duration-200" - id="date" - name="date" - required="" - type="date" - value="2025-09-26" - /> - </div> - <div> - <label - class="block text-sm font-medium text-gray-700 dark:text-fitfest-subtle mb-1" - for="name" - > - Meal Name - </label> - <input - class="w-full px-3 py-2 border border-gray-300 dark:border-fitfest-subtle/20 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-fitfest-dark-tertiary text-gray-900 dark:text-fitfest-subtle placeholder-gray-500 dark:placeholder-fitfest-subtle/50 transition-colors duration-200" - id="name" - name="name" - placeholder="e.g., Oatmeal with berries" - required="" - type="text" - value="a" - /> - </div> - <div> - <label - class="block text-sm font-medium text-gray-700 dark:text-fitfest-subtle mb-1" - for="calories" - > - Calories - </label> - <input - class="w-full px-3 py-2 border border-gray-300 dark:border-fitfest-subtle/20 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-fitfest-dark-tertiary text-gray-900 dark:text-fitfest-subtle placeholder-gray-500 dark:placeholder-fitfest-subtle/50 transition-colors duration-200" - id="calories" - min="0" - name="calories" - placeholder="e.g., 300" - required="" - type="number" - value="" - /> - </div> - <div - class="grid grid-cols-3 gap-3" - > - <div> - <label - class="block text-sm font-medium text-gray-700 dark:text-fitfest-subtle mb-1" - for="protein" - > - Protein (g) - </label> - <input - class="w-full px-3 py-2 border border-gray-300 dark:border-fitfest-subtle/20 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-fitfest-dark-tertiary text-gray-900 dark:text-fitfest-subtle placeholder-gray-500 dark:placeholder-fitfest-subtle/50 transition-colors duration-200" - id="protein" - min="0" - name="protein" - placeholder="0" - step="0.1" - type="number" - value="" - /> - </div> - <div> - <label - class="block text-sm font-medium text-gray-700 dark:text-fitfest-subtle mb-1" - for="carbs" - > - Carbs (g) - </label> - <input - class="w-full px-3 py-2 border border-gray-300 dark:border-fitfest-subtle/20 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-fitfest-dark-tertiary text-gray-900 dark:text-fitfest-subtle placeholder-gray-500 dark:placeholder-fitfest-subtle/50 transition-colors duration-200" - id="carbs" - min="0" - name="carbs" - placeholder="0" - step="0.1" - type="number" - value="" - /> - </div> - <div> - <label - class="block text-sm font-medium text-gray-700 dark:text-fitfest-subtle mb-1" - for="fat" - > - Fat (g) - </label> - <input - class="w-full px-3 py-2 border border-gray-300 dark:border-fitfest-subtle/20 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-fitfest-dark-tertiary text-gray-900 dark:text-fitfest-subtle placeholder-gray-500 dark:placeholder-fitfest-subtle/50 transition-colors duration-200" - id="fat" - min="0" - name="fat" - placeholder="0" - step="0.1" - type="number" - value="" - /> - </div> - </div> - <div - class="flex gap-3 pt-4" - > - <button - class="flex-1 px-4 py-2 text-gray-700 dark:text-fitfest-subtle bg-gray-100 dark:bg-fitfest-dark-tertiary border border-gray-300 dark:border-fitfest-subtle/20 rounded-md hover:bg-gray-200 dark:hover:bg-fitfest-dark-tertiary/80 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:border-transparent transition-colors duration-200" - type="button" - > - Cancel - </button> - <button - class="flex-1 px-4 py-2 text-white bg-blue-600 border border-transparent rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed" - type="submit" - > - Save Meal - </button> - </div> - </form> - </div> - </div> - </div> - </body> -</html> - at /Users/shannonanahata/fitfest/app/src/tests/MealLogForm.test.tsx:352:17 - at runWithExpensiveErrorDiagnosticsDisabled (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/config.js:47:12) - at checkCallback (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait-for.js:124:77) - at checkRealTimersCallback (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait-for.js:118:16) - at Timeout.task [as _onTimeout] (/Users/shannonanahata/fitfest/app/node_modules/jsdom/lib/jsdom/browser/Window.js:520:19) - at listOnTimeout (node:internal/timers:611:17) - at processTimers (node:internal/timers:546:7) - - - - - Error: Unable to find a label with the text of: Calories - -Ignored nodes: comments, script, style -<body> - <div /> -</body> - at waitForWrapper (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait-for.js:163:27) - at Object.<anonymous> (/Users/shannonanahata/fitfest/app/src/tests/MealLogForm.test.tsx:397:20) - at Promise.then.completed (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:298:28) - at new Promise (<anonymous>) - at callAsyncCircusFn (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:231:10) - at _callCircusTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:316:40) - at _runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:252:3) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:126:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at run (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:71:3) - at runAndTransformResultsToJestFormat (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) - at jestAdapter (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) - at runTestInternal (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:367:16) - at runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:444:34) - at Object.worker (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/testWorker.js:106:12) - - - - - - - - - - - - - - - Error: Unable to find an element with the text: Friday. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. - -Ignored nodes: comments, script, style -<body> - <div> - <div - class="min-h-screen bg-fitfest-light dark:bg-fitfest-dark transition-colors duration-200" - > - <div - class="bg-white dark:bg-fitfest-dark-secondary shadow-sm border-b border-fitfest-subtle/20 dark:border-fitfest-subtle/10 transition-colors duration-200" - > - <div - class="flex items-center justify-between p-4" - > - <div - class="flex items-center gap-3" - > - <button - class="p-2 hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary rounded-full transition-colors duration-200" - > - <svg - aria-hidden="true" - class="w-5 h-5 text-fitfest-text dark:text-fitfest-subtle" - data-slot="icon" - fill="none" - stroke="currentColor" - stroke-width="1.5" - viewBox="0 0 24 24" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M15.75 19.5 8.25 12l7.5-7.5" - stroke-linecap="round" - stroke-linejoin="round" - /> - </svg> - </button> - <h1 - class="text-xl font-bold text-fitfest-deep dark:text-fitfest-subtle" - > - Food diary - </h1> - </div> - </div> - <div - class="px-4 pb-4" - > - <p - class="text-fitfest-text dark:text-fitfest-subtle text-sm" - > - Friday - , - September 26 - </p> - </div> - <div - class="px-4 pb-4" - > - <div - class="flex gap-2 overflow-x-auto" - > - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Mon - </span> - <span - class="text-lg" - > - 22 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Tue - </span> - <span - class="text-lg" - > - 23 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Wed - </span> - <span - class="text-lg" - > - 24 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Thu - </span> - <span - class="text-lg" - > - 25 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-fitfest-deep text-white dark:bg-fitfest-bright dark:text-fitfest-dark" - > - <span - class="text-xs opacity-70" - > - Today - </span> - <span - class="text-lg" - > - 26 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Sat - </span> - <span - class="text-... - at waitForWrapper (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait-for.js:163:27) - at Object.<anonymous> (/Users/shannonanahata/fitfest/app/src/tests/NutritionPage.test.tsx:94:20) - at Promise.then.completed (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:298:28) - at new Promise (<anonymous>) - at callAsyncCircusFn (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:231:10) - at _callCircusTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:316:40) - at runNextTicks (node:internal/process/task_queues:65:5) - at listOnTimeout (node:internal/timers:572:9) - at processTimers (node:internal/timers:546:7) - at _runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:252:3) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:126:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at run (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:71:3) - at runAndTransformResultsToJestFormat (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) - at jestAdapter (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) - at runTestInternal (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:367:16) - at runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:444:34) - at Object.worker (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/testWorker.js:106:12) - - - - - Error: expect(jest.fn()).toHaveBeenCalledWith(...expected) - -Expected: StringContaining "/api/meals?date=", Any<Object> -Received - 1: "/api/auth/session", {"credentials": "include", "headers": {"Cache-Control": "no-cache"}} - 2: "/api/profile", {"credentials": "include"} - 3: "/api/meals?date=2025-09-26" - -Number of calls: 3 - -Ignored nodes: comments, script, style -<html> - <head /> - <body> - <div> - <div - class="min-h-screen bg-fitfest-light dark:bg-fitfest-dark transition-colors duration-200" - > - <div - class="bg-white dark:bg-fitfest-dark-secondary shadow-sm border-b border-fitfest-subtle/20 dark:border-fitfest-subtle/10 transition-colors duration-200" - > - <div - class="flex items-center justify-between p-4" - > - <div - class="flex items-center gap-3" - > - <button - class="p-2 hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary rounded-full transition-colors duration-200" - > - <svg - aria-hidden="true" - class="w-5 h-5 text-fitfest-text dark:text-fitfest-subtle" - data-slot="icon" - fill="none" - stroke="currentColor" - stroke-width="1.5" - viewBox="0 0 24 24" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M15.75 19.5 8.25 12l7.5-7.5" - stroke-linecap="round" - stroke-linejoin="round" - /> - </svg> - </button> - <h1 - class="text-xl font-bold text-fitfest-deep dark:text-fitfest-subtle" - > - Food diary - </h1> - </div> - </div> - <div - class="px-4 pb-4" - > - <p - class="text-fitfest-text dark:text-fitfest-subtle text-sm" - > - Friday - , - September 26 - </p> - </div> - <div - class="px-4 pb-4" - > - <div - class="flex gap-2 overflow-x-auto" - > - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Mon - </span> - <span - class="text-lg" - > - 22 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Tue - </span> - <span - class="text-lg" - > - 23 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Wed - </span> - <span - class="text-lg" - > - 24 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Thu - </span> - <span - class="text-lg" - > - 25 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-fitfest-deep text-white dark:bg-fitfest-bright dark:text-fitfest-dark" - > - <span - class="text-xs opacity-70" - > - Today - </span> - <span - class="text-lg" - > - 26 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fi... - at toHaveBeenCalledWith (/Users/shannonanahata/fitfest/app/src/tests/NutritionPage.test.tsx:115:23) - at runWithExpensiveErrorDiagnosticsDisabled (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/config.js:47:12) - at checkCallback (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait-for.js:124:77) - at checkRealTimersCallback (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait-for.js:118:16) - at Timeout.task [as _onTimeout] (/Users/shannonanahata/fitfest/app/node_modules/jsdom/lib/jsdom/browser/Window.js:520:19) - at listOnTimeout (node:internal/timers:611:17) - at processTimers (node:internal/timers:546:7) - - - Error: Unable to find an element with the text: 550. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. - -Ignored nodes: comments, script, style -<body> - <div> - <div - class="min-h-screen bg-fitfest-light dark:bg-fitfest-dark transition-colors duration-200" - > - <div - class="bg-white dark:bg-fitfest-dark-secondary shadow-sm border-b border-fitfest-subtle/20 dark:border-fitfest-subtle/10 transition-colors duration-200" - > - <div - class="flex items-center justify-between p-4" - > - <div - class="flex items-center gap-3" - > - <button - class="p-2 hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary rounded-full transition-colors duration-200" - > - <svg - aria-hidden="true" - class="w-5 h-5 text-fitfest-text dark:text-fitfest-subtle" - data-slot="icon" - fill="none" - stroke="currentColor" - stroke-width="1.5" - viewBox="0 0 24 24" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M15.75 19.5 8.25 12l7.5-7.5" - stroke-linecap="round" - stroke-linejoin="round" - /> - </svg> - </button> - <h1 - class="text-xl font-bold text-fitfest-deep dark:text-fitfest-subtle" - > - Food diary - </h1> - </div> - </div> - <div - class="px-4 pb-4" - > - <p - class="text-fitfest-text dark:text-fitfest-subtle text-sm" - > - Friday - , - September 26 - </p> - </div> - <div - class="px-4 pb-4" - > - <div - class="flex gap-2 overflow-x-auto" - > - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Mon - </span> - <span - class="text-lg" - > - 22 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Tue - </span> - <span - class="text-lg" - > - 23 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Wed - </span> - <span - class="text-lg" - > - 24 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Thu - </span> - <span - class="text-lg" - > - 25 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-fitfest-deep text-white dark:bg-fitfest-bright dark:text-fitfest-dark" - > - <span - class="text-xs opacity-70" - > - Today - </span> - <span - class="text-lg" - > - 26 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Sat - </span> - <span - class="text-... - at waitForWrapper (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait-for.js:163:27) - at Object.<anonymous> (/Users/shannonanahata/fitfest/app/src/tests/NutritionPage.test.tsx:167:20) - at Promise.then.completed (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:298:28) - at new Promise (<anonymous>) - at callAsyncCircusFn (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:231:10) - at _callCircusTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:316:40) - at _runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:252:3) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:126:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at run (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:71:3) - at runAndTransformResultsToJestFormat (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) - at jestAdapter (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) - at runTestInternal (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:367:16) - at runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:444:34) - at Object.worker (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/testWorker.js:106:12) - - - Error: Unable to find an element with the text: 33. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. - -Ignored nodes: comments, script, style -<body> - <div> - <div - class="min-h-screen bg-fitfest-light dark:bg-fitfest-dark transition-colors duration-200" - > - <div - class="bg-white dark:bg-fitfest-dark-secondary shadow-sm border-b border-fitfest-subtle/20 dark:border-fitfest-subtle/10 transition-colors duration-200" - > - <div - class="flex items-center justify-between p-4" - > - <div - class="flex items-center gap-3" - > - <button - class="p-2 hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary rounded-full transition-colors duration-200" - > - <svg - aria-hidden="true" - class="w-5 h-5 text-fitfest-text dark:text-fitfest-subtle" - data-slot="icon" - fill="none" - stroke="currentColor" - stroke-width="1.5" - viewBox="0 0 24 24" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M15.75 19.5 8.25 12l7.5-7.5" - stroke-linecap="round" - stroke-linejoin="round" - /> - </svg> - </button> - <h1 - class="text-xl font-bold text-fitfest-deep dark:text-fitfest-subtle" - > - Food diary - </h1> - </div> - </div> - <div - class="px-4 pb-4" - > - <p - class="text-fitfest-text dark:text-fitfest-subtle text-sm" - > - Friday - , - September 26 - </p> - </div> - <div - class="px-4 pb-4" - > - <div - class="flex gap-2 overflow-x-auto" - > - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Mon - </span> - <span - class="text-lg" - > - 22 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Tue - </span> - <span - class="text-lg" - > - 23 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Wed - </span> - <span - class="text-lg" - > - 24 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Thu - </span> - <span - class="text-lg" - > - 25 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-fitfest-deep text-white dark:bg-fitfest-bright dark:text-fitfest-dark" - > - <span - class="text-xs opacity-70" - > - Today - </span> - <span - class="text-lg" - > - 26 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Sat - </span> - <span - class="text-... - at waitForWrapper (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait-for.js:163:27) - at Object.<anonymous> (/Users/shannonanahata/fitfest/app/src/tests/NutritionPage.test.tsx:176:20) - at Promise.then.completed (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:298:28) - at new Promise (<anonymous>) - at callAsyncCircusFn (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:231:10) - at _callCircusTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:316:40) - at _runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:252:3) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:126:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at run (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:71:3) - at runAndTransformResultsToJestFormat (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) - at jestAdapter (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) - at runTestInternal (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:367:16) - at runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:444:34) - at Object.worker (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/testWorker.js:106:12) - - - Error: Unable to find an element with the text: Chicken Salad. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. - -Ignored nodes: comments, script, style -<body> - <div> - <div - class="min-h-screen bg-fitfest-light dark:bg-fitfest-dark transition-colors duration-200" - > - <div - class="bg-white dark:bg-fitfest-dark-secondary shadow-sm border-b border-fitfest-subtle/20 dark:border-fitfest-subtle/10 transition-colors duration-200" - > - <div - class="flex items-center justify-between p-4" - > - <div - class="flex items-center gap-3" - > - <button - class="p-2 hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary rounded-full transition-colors duration-200" - > - <svg - aria-hidden="true" - class="w-5 h-5 text-fitfest-text dark:text-fitfest-subtle" - data-slot="icon" - fill="none" - stroke="currentColor" - stroke-width="1.5" - viewBox="0 0 24 24" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M15.75 19.5 8.25 12l7.5-7.5" - stroke-linecap="round" - stroke-linejoin="round" - /> - </svg> - </button> - <h1 - class="text-xl font-bold text-fitfest-deep dark:text-fitfest-subtle" - > - Food diary - </h1> - </div> - </div> - <div - class="px-4 pb-4" - > - <p - class="text-fitfest-text dark:text-fitfest-subtle text-sm" - > - Friday - , - September 26 - </p> - </div> - <div - class="px-4 pb-4" - > - <div - class="flex gap-2 overflow-x-auto" - > - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Mon - </span> - <span - class="text-lg" - > - 22 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Tue - </span> - <span - class="text-lg" - > - 23 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Wed - </span> - <span - class="text-lg" - > - 24 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Thu - </span> - <span - class="text-lg" - > - 25 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-fitfest-deep text-white dark:bg-fitfest-bright dark:text-fitfest-dark" - > - <span - class="text-xs opacity-70" - > - Today - </span> - <span - class="text-lg" - > - 26 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Sat - </span> - <span - class="text-... - at waitForWrapper (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait-for.js:163:27) - at Object.<anonymous> (/Users/shannonanahata/fitfest/app/src/tests/NutritionPage.test.tsx:186:20) - at Promise.then.completed (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:298:28) - at new Promise (<anonymous>) - at callAsyncCircusFn (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:231:10) - at _callCircusTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:316:40) - at _runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:252:3) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:126:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at run (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:71:3) - at runAndTransformResultsToJestFormat (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) - at jestAdapter (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) - at runTestInternal (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:367:16) - at runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:444:34) - at Object.worker (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/testWorker.js:106:12) - - - Error: Unable to find an element with the text: Apple. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. - -Ignored nodes: comments, script, style -<body> - <div> - <div - class="min-h-screen bg-fitfest-light dark:bg-fitfest-dark transition-colors duration-200" - > - <div - class="bg-white dark:bg-fitfest-dark-secondary shadow-sm border-b border-fitfest-subtle/20 dark:border-fitfest-subtle/10 transition-colors duration-200" - > - <div - class="flex items-center justify-between p-4" - > - <div - class="flex items-center gap-3" - > - <button - class="p-2 hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary rounded-full transition-colors duration-200" - > - <svg - aria-hidden="true" - class="w-5 h-5 text-fitfest-text dark:text-fitfest-subtle" - data-slot="icon" - fill="none" - stroke="currentColor" - stroke-width="1.5" - viewBox="0 0 24 24" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M15.75 19.5 8.25 12l7.5-7.5" - stroke-linecap="round" - stroke-linejoin="round" - /> - </svg> - </button> - <h1 - class="text-xl font-bold text-fitfest-deep dark:text-fitfest-subtle" - > - Food diary - </h1> - </div> - </div> - <div - class="px-4 pb-4" - > - <p - class="text-fitfest-text dark:text-fitfest-subtle text-sm" - > - Friday - , - September 26 - </p> - </div> - <div - class="px-4 pb-4" - > - <div - class="flex gap-2 overflow-x-auto" - > - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Mon - </span> - <span - class="text-lg" - > - 22 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Tue - </span> - <span - class="text-lg" - > - 23 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Wed - </span> - <span - class="text-lg" - > - 24 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Thu - </span> - <span - class="text-lg" - > - 25 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-fitfest-deep text-white dark:bg-fitfest-bright dark:text-fitfest-dark" - > - <span - class="text-xs opacity-70" - > - Today - </span> - <span - class="text-lg" - > - 26 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Sat - </span> - <span - class="text-... - at waitForWrapper (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait-for.js:163:27) - at Object.<anonymous> (/Users/shannonanahata/fitfest/app/src/tests/NutritionPage.test.tsx:235:20) - at Promise.then.completed (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:298:28) - at new Promise (<anonymous>) - at callAsyncCircusFn (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:231:10) - at _callCircusTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:316:40) - at _runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:252:3) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:126:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at run (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:71:3) - at runAndTransformResultsToJestFormat (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) - at jestAdapter (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) - at runTestInternal (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:367:16) - at runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:444:34) - at Object.worker (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/testWorker.js:106:12) - - - - - - - - - - - - - - - Error: expect(element).toHaveClass("dark:bg-fitfest-dark-secondary") - -Expected the element to have class: - dark:bg-fitfest-dark-secondary -Received: - flex items-center gap-3 - -Ignored nodes: comments, script, style -<html> - <head /> - <body> - <div> - <div - class="min-h-screen bg-fitfest-light dark:bg-fitfest-dark transition-colors duration-200" - > - <div - class="bg-white dark:bg-fitfest-dark-secondary shadow-sm border-b border-fitfest-subtle/20 dark:border-fitfest-subtle/10 transition-colors duration-200" - > - <div - class="flex items-center justify-between p-4" - > - <div - class="flex items-center gap-3" - > - <button - class="p-2 hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary rounded-full transition-colors duration-200" - > - <svg - aria-hidden="true" - class="w-5 h-5 text-fitfest-text dark:text-fitfest-subtle" - data-slot="icon" - fill="none" - stroke="currentColor" - stroke-width="1.5" - viewBox="0 0 24 24" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M15.75 19.5 8.25 12l7.5-7.5" - stroke-linecap="round" - stroke-linejoin="round" - /> - </svg> - </button> - <h1 - class="text-xl font-bold text-fitfest-deep dark:text-fitfest-subtle" - > - Food diary - </h1> - </div> - </div> - <div - class="px-4 pb-4" - > - <p - class="text-fitfest-text dark:text-fitfest-subtle text-sm" - > - Friday - , - September 26 - </p> - </div> - <div - class="px-4 pb-4" - > - <div - class="flex gap-2 overflow-x-auto" - > - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Mon - </span> - <span - class="text-lg" - > - 22 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Tue - </span> - <span - class="text-lg" - > - 23 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Wed - </span> - <span - class="text-lg" - > - 24 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Thu - </span> - <span - class="text-lg" - > - 25 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-fitfest-deep text-white dark:bg-fitfest-bright dark:text-fitfest-dark" - > - <span - class="text-xs opacity-70" - > - Today - </span> - <span - class="text-lg" - > - 26 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fi... - at toHaveClass (/Users/shannonanahata/fitfest/app/src/tests/NutritionPage.test.tsx:360:27) - at runWithExpensiveErrorDiagnosticsDisabled (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/config.js:47:12) - at checkCallback (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait-for.js:124:77) - at checkRealTimersCallback (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait-for.js:118:16) - at Timeout.task [as _onTimeout] (/Users/shannonanahata/fitfest/app/node_modules/jsdom/lib/jsdom/browser/Window.js:520:19) - at listOnTimeout (node:internal/timers:611:17) - at processTimers (node:internal/timers:546:7) + - + - - Error: Found multiple elements with the text: 0 - -Here are the matching elements: - -Ignored nodes: comments, script, style -<div - class="text-4xl font-bold text-fitfest-deep dark:text-fitfest-subtle mb-1" -> - 0 -</div> - -Ignored nodes: comments, script, style -<div - class="text-lg font-bold text-fitfest-deep dark:text-fitfest-subtle mb-2" -> - 0 - <span - class="text-sm font-normal text-fitfest-subtle dark:text-fitfest-subtle/70" - > - / - 98 - g - </span> -</div> - -Ignored nodes: comments, script, style -<div - class="text-lg font-bold text-fitfest-deep dark:text-fitfest-subtle mb-2" -> - 0 - <span - class="text-sm font-normal text-fitfest-subtle dark:text-fitfest-subtle/70" - > - / - 244 - g - </span> -</div> - -Ignored nodes: comments, script, style -<div - class="text-lg font-bold text-fitfest-deep dark:text-fitfest-subtle mb-2" -> - 0 - <span - class="text-sm font-normal text-fitfest-subtle dark:text-fitfest-subtle/70" - > - / - 68 - g - </span> -</div> - -(If this is intentional, then use the `*AllBy*` variant of the query (like `queryAllByText`, `getAllByText`, or `findAllByText`)). - -Ignored nodes: comments, script, style -<body> - <div> - <div - class="min-h-screen bg-fitfest-light dark:bg-fitfest-dark transition-colors duration-200" - > - <div - class="bg-white dark:bg-fitfest-dark-secondary shadow-sm border-b border-fitfest-subtle/20 dark:border-fitfest-subtle/10 transition-colors duration-200" - > - <div - class="flex items-center justify-between p-4" - > - <div - class="flex items-center gap-3" - > - <button - class="p-2 hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary rounded-full transition-colors duration-200" - > - <svg - aria-hidden="true" - class="w-5 h-5 text-fitfest-text dark:text-fitfest-subtle" - data-slot="icon" - fill="none" - stroke="currentColor" - stroke-width="1.5" - viewBox="0 0 24 24" - xmlns="http://www.w3.org/2000/svg" - > - <path - d="M15.75 19.5 8.25 12l7.5-7.5" - stroke-linecap="round" - stroke-linejoin="round" - /> - </svg> - </button> - <h1 - class="text-xl font-bold text-fitfest-deep dark:text-fitfest-subtle" - > - Food diary - </h1> - </div> - </div> - <div - class="px-4 pb-4" - > - <p - class="text-fitfest-text dark:text-fitfest-subtle text-sm" - > - Friday - , - September 26 - </p> - </div> - <div - class="px-4 pb-4" - > - <div - class="flex gap-2 overflow-x-auto" - > - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Mon - </span> - <span - class="text-lg" - > - 22 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Tue - </span> - <span - class="text-lg" - > - 23 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Wed - </span> - <span - class="text-lg" - > - 24 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Thu - </span> - <span - class="text-lg" - > - 25 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-fitfest-deep text-white dark:bg-fitfest-bright dark:text-fitfest-dark" - > - <span - class="text-xs opacity-70" - > - Today - </span> - <span - class="text-lg" - > - 26 - </span> - </button> - <button - class="flex flex-col items-center justify-center min-w-[60px] h-16 rounded-lg text-sm font-medium transition-colors bg-white dark:bg-fitfest-dark-secondary text-fitfest-text dark:text-fitfest-subtle hover:bg-fitfest-light dark:hover:bg-fitfest-dark-tertiary border border-fitfest-subtle/20 dark:border-fitfest-subtle/10" - > - <span - class="text-xs opacity-70" - > - Sat - </span> - <span - class="text-... - at waitForWrapper (/Users/shannonanahata/fitfest/app/node_modules/@testing-library/react/node_modules/@testing-library/dom/dist/wait-for.js:163:27) - at Object.<anonymous> (/Users/shannonanahata/fitfest/app/src/tests/NutritionPage.test.tsx:413:20) - at Promise.then.completed (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:298:28) - at new Promise (<anonymous>) - at callAsyncCircusFn (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/utils.js:231:10) - at _callCircusTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:316:40) - at runNextTicks (node:internal/process/task_queues:65:5) - at listOnTimeout (node:internal/timers:572:9) - at processTimers (node:internal/timers:546:7) - at _runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:252:3) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:126:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at _runTestsForDescribeBlock (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:121:9) - at run (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/run.js:71:3) - at runAndTransformResultsToJestFormat (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21) - at jestAdapter (/Users/shannonanahata/fitfest/app/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19) - at runTestInternal (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:367:16) - at runTest (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/runTest.js:444:34) - at Object.worker (/Users/shannonanahata/fitfest/app/node_modules/jest-runner/build/testWorker.js:106:12) + \ No newline at end of file From 7ffe8347f6e312191185773705a74f36854ccc76 Mon Sep 17 00:00:00 2001 From: Shannon Anahata Date: Fri, 26 Sep 2025 12:46:25 -0700 Subject: [PATCH 2/4] Fix Sentry Test Analytics integration with OpenID Connect --- .github/workflows/codecov.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index f75d032..0c5b68e 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -6,6 +6,9 @@ on: pull_request: branches: ['**'] # Run on PRs to any branch +permissions: + id-token: write + jobs: test: runs-on: ubuntu-latest @@ -31,11 +34,7 @@ jobs: continue-on-error: true # Allow flaky tests to not fail the build - name: Upload test results to Sentry if: ${{ !cancelled() }} - uses: getsentry/prevent-action - with: - token: ${{ secrets.SENTRY_PREVENT_TOKEN }} - report-type: test-results - files: ./test-results.junit.xml + uses: getsentry/prevent-action@latest # - name: Upload coverage reports to Codecov # uses: codecov/codecov-action@v5 # with: From 5c1dd4248742b84181d7e7b948e5df68a664e6a3 Mon Sep 17 00:00:00 2001 From: Shannon Anahata Date: Fri, 26 Sep 2025 12:50:03 -0700 Subject: [PATCH 3/4] workflow fix --- .github/workflows/codecov.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 0c5b68e..a52db5c 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -34,7 +34,7 @@ jobs: continue-on-error: true # Allow flaky tests to not fail the build - name: Upload test results to Sentry if: ${{ !cancelled() }} - uses: getsentry/prevent-action@latest + uses: getsentry/prevent-action # - name: Upload coverage reports to Codecov # uses: codecov/codecov-action@v5 # with: From 7148cad97e99e797e1075c894f614d61dc6d6b45 Mon Sep 17 00:00:00 2001 From: Shannon Anahata Date: Fri, 26 Sep 2025 12:56:10 -0700 Subject: [PATCH 4/4] getting workflows to work --- .github/workflows/codecov.yml | 66 ++++++++++----------- .github/workflows/sentry-test-analytics.yml | 45 ++++++++++++++ 2 files changed, 78 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/sentry-test-analytics.yml diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index a52db5c..1c42ca5 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,40 +1,40 @@ name: Codecov Coverage & Sentry Test Analytics -on: - push: - branches: ['**'] # Run on all branches - pull_request: - branches: ['**'] # Run on PRs to any branch +# on: +# push: +# branches: ['**'] # Run on all branches +# pull_request: +# branches: ['**'] # Run on PRs to any branch -permissions: - id-token: write +# permissions: +# id-token: write -jobs: - test: - runs-on: ubuntu-latest - defaults: - run: - working-directory: app # This ensures all commands run in the /app directory - steps: - - uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: 20 - - name: Install dependencies - run: npm ci - - name: Run tests with coverage and JUnit output - run: | - # Install jest-junit if not already available - npm install --save-dev jest-junit - # Run tests with both coverage and JUnit output for Sentry Test Analytics - npx jest --coverage --testResultsProcessor=jest-junit --outputFile=test-results.junit.xml - env: - NODE_ENV: test - continue-on-error: true # Allow flaky tests to not fail the build - - name: Upload test results to Sentry - if: ${{ !cancelled() }} - uses: getsentry/prevent-action +# jobs: +# test: +# runs-on: ubuntu-latest +# defaults: +# run: +# working-directory: app # This ensures all commands run in the /app directory +# steps: +# - uses: actions/checkout@v4 +# - name: Set up Node.js +# uses: actions/setup-node@v4 +# with: +# node-version: 20 +# - name: Install dependencies +# run: npm ci +# - name: Run tests with coverage and JUnit output +# run: | +# # Install jest-junit if not already available +# npm install --save-dev jest-junit +# # Run tests with both coverage and JUnit output for Sentry Test Analytics +# npx jest --coverage --testResultsProcessor=jest-junit --outputFile=test-results.junit.xml +# env: +# NODE_ENV: test +# continue-on-error: true # Allow flaky tests to not fail the build +# - name: Upload test results to Sentry +# if: ${{ !cancelled() }} +# uses: getsentry/prevent-action # - name: Upload coverage reports to Codecov # uses: codecov/codecov-action@v5 # with: diff --git a/.github/workflows/sentry-test-analytics.yml b/.github/workflows/sentry-test-analytics.yml new file mode 100644 index 0000000..d3a36f6 --- /dev/null +++ b/.github/workflows/sentry-test-analytics.yml @@ -0,0 +1,45 @@ +name: Sentry Test Analytics + +on: + push: + branches: ['**'] # Run on all branches + pull_request: + branches: ['**'] # Run on PRs to any branch + +permissions: + id-token: write + +jobs: + test: + runs-on: ubuntu-latest + defaults: + run: + working-directory: app # This ensures all commands run in the /app directory + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'npm' + cache-dependency-path: app/package-lock.json + + - name: Install dependencies + run: npm ci + + - name: Run tests with JUnit output + run: | + # Install jest-junit if not already available + npm install --save-dev jest-junit + # Run tests with JUnit output for Sentry Test Analytics + npx jest --testResultsProcessor=jest-junit --outputFile=test-results.junit.xml + env: + NODE_ENV: test + continue-on-error: true # Allow flaky tests to not fail the build + + - name: Upload test results to Sentry + if: ${{ !cancelled() }} + uses: getsentry/prevent-action