• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SNApp-notes / web / 19448920074

18 Nov 2025 12:05AM UTC coverage: 67.983% (-0.4%) from 68.4%
19448920074

push

github

jcubic
fix lint errors

461 of 703 branches covered (65.58%)

Branch coverage included in aggregate %.

3 of 3 new or added lines in 2 files covered. (100.0%)

70 existing lines in 4 files now uncovered.

830 of 1196 relevant lines covered (69.4%)

461.88 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/app/NotesLayoutWrapper.tsx
1
import { auth } from '@/lib/auth';
2
import { headers } from 'next/headers';
3
import type { Note } from '@/lib/prisma';
4
import type { NoteTreeNode } from '@/types/tree';
5
import { getNotes } from '@/app/actions/notes';
6
import { NotesProvider } from '@/components/notes/NotesContext';
7

8
interface NotesLayoutWrapperProps {
9
  children: React.ReactNode;
10
}
11

12
// Convert Prisma Note to NoteTreeNode
13
function convertNoteToTreeNode(note: Note): NoteTreeNode {
14
  return {
×
15
    id: note.noteId,
16
    name: note.name,
17
    selected: false,
18
    data: {
19
      content: note.content, // Preserve null for example notes
20
      dirty: false,
21
      createdAt: note.createdAt,
22
      updatedAt: note.updatedAt
23
    }
24
  };
25
}
26

27
export default async function NotesLayoutWrapper({ children }: NotesLayoutWrapperProps) {
28
  // Check if user is authenticated
UNCOV
29
  const session = await auth.api.getSession({
×
30
    headers: await headers()
31
  });
32

33
  // Only load notes if user is authenticated
34
  let treeNodes: NoteTreeNode[] = [];
×
35
  if (session?.user) {
×
36
    try {
×
UNCOV
37
      const notes = await getNotes();
×
38
      treeNodes = notes.map(convertNoteToTreeNode);
×
39
    } catch (error) {
UNCOV
40
      console.error('Failed to load notes:', error);
×
41
      // Continue with empty notes array
42
    }
43
  }
44

UNCOV
45
  return (
×
46
    <NotesProvider initialNotes={treeNodes} initialSelectedNoteId={null}>
47
      {children}
48
    </NotesProvider>
49
  );
50
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc