Frontend Test Report & Coverage - bounswe/bounswe2024group1 GitHub Wiki

Frontend Test Reports

Vitest UI Report

Ran on commit ed4682

  ✓ src/App.test.tsx (1)
   ✓ welcome test is shown
 ✓ src/routes/bookmarks.test.tsx (2)
   ✓ BookmarkedQuestions component (2)
     ✓ should have no accessibility violations
     ✓ renders bookmarked questions correctly
 ✓ src/routes/create-question.test.tsx (4)
   ✓ QuestionCreationPage (4)
     ✓ renders the form correctly
     ✓ shows validation errors for empty fields
     ✓ loads tags from URL parameters
     ✓ toggles preview mode
 ✓ src/routes/glossary.test.tsx (3)
   ✓ GlossaryPage (3)
     ✓ renders glossary title correctly
     ✓ renders tag counts and descriptions correctly
     ✓ renders error alert when there is an error
 ✓ src/routes/home.test.tsx (2)
   ✓ should have no accessibility violations
   ✓ home route renders
 ✓ src/routes/login.test.tsx (3)
   ✓ should have no accessibility violations
   ✓ login calls service
   ✓ log in button goes to /login
 ✓ src/routes/profile.test.tsx (5)
   ✓ Profile component (5)
     ✓ should have no accessibility violations
     ✓ renders loading state
     ✓ displays user data correctly
     ✓ allows editing and updating profile
     ✓ shows error message on profile fetch error
 ✓ src/routes/question.test.tsx (6) 524ms
   ✓ QuestionPage (6) 524ms
     ✓ should have no accessibility violations 372ms
     ✓ renders question details correctly
     ✓ does not render delete button for non-author
     ✓ renders delete button for author
     ✓ renders bookmark button
     ✓ updates difficulty counts when voting
 ✓ src/routes/search.test.tsx (5)
   ✓ Search component (5)
     ✓ should have no accessibility violations
     ✓ renders loading state
     ✓ renders tags correctly
     ✓ renders no results message
     ✓ renders error state
 ✓ src/routes/signup.test.tsx (4) 838ms
   ✓ should have no accessibility violations
   ✓ signup calls service
   ✓ signup with invalid email shows validation error
   ✓ signup with invalid password shows validation error
 ✓ src/routes/tag.test.tsx (2)
   ✓ TagPage (2)
     ✓ renders tag details correctly
     ✓ renders 'Follow' button for authenticated users
 ✓ src/components/AnswerCard.test.tsx (4)
   ✓ AnswerCard (4)
     ✓ renders answer card with correct content
     ✓ renders author profile picture
     ✓ renders default profile picture when author picture is not provided
     ✓ contains correct navigation links
 ✓ src/components/Answers.test.tsx (4)
   ✓ Answers (4)
     ✓ renders answers correctly
     ✓ does not show vote buttons for unauthorized users
     ✓ shows vote buttons for authorized users
     ✓ calls upvoteAnswer when authorized user votes
 ✓ src/components/CodeSnippet.test.tsx (6)
   ✓ CodeSnippet (6)
     ✓ renders code snippet with correct language
     ✓ handles code execution
     ✓ shows loading state during execution
     ✓ shows success output after execution
     ✓ shows error message on execution failure
     ✓ copies code to clipboard when copy button is clicked
 ✓ src/components/CreateAnswerForm.test.tsx (8)
   ✓ CreateAnswerForm (8)
     ✓ renders form elements correctly
     ✓ toggles between write and preview modes
     ✓ preview/write buttons do not submit the form
     ✓ submits form with content when Post Answer is clicked
     ✓ disables submit button when content is empty
     ✓ shows loading state while submitting
     ✓ clears textarea after successful submission
     ✓ renders popover content when info button is clicked
 ✓ src/components/CreateTagForm.test.tsx (6)
   ✓ CreateTagForm (6)
     ✓ renders form elements correctly
     ✓ submits form with valid data when 'Create Tag' is clicked
     ✓ disables submit button when form is empty
     ✓ shows loading state while creating the tag
     ✓ clears form inputs after successful submission
     ✓ does not submit if fields are empty
 ✓ src/components/CreateTagPage.test.tsx (6)
   ✓ CreateTagPage (6)
     ✓ renders CreateTagForm correctly
     ✓ submits the form with valid data
     ✓ disables the submit button when fields are empty
     ✓ enables the submit button when fields are filled
     ✓ displays loading state while submitting
     ✓ clears the input fields after successful submission
 ✓ src/components/CustomAnchor.test.tsx (7)
   ✓ CustomAnchor (7)
     ✓ renders a span when no href is provided
     ✓ renders an anchor with correct href when provided
     ✓ navigates to tag page when tag link is clicked
     ✓ navigates to question page when question link is clicked
     ✓ sets correct title for tag links
     ✓ sets correct title for question links
     ✓ sets loading title for invalid href patterns
 ✓ src/components/ExerciseCard.test.tsx (4)
   ✓ ExerciseCard (4)
     ✓ renders exercise card with correct content
     ✓ renders all tags correctly
     ✓ contains correct exercism link
     ✓ displays difficulty label correctly
 ✓ src/components/FilterCheckbox.test.tsx (2)
   ✓ label renders text with label
   ✓ clicking on the label triggers onChange
 ✓ src/components/SearchBar.test.tsx (6) 313ms
   ✓ SearchBar (6) 312ms
     ✓ shows tooltip on first load and hides after 3 seconds
     ✓ shows tooltip on focus after first load
     ✓ focuses search input when '/' is pressed
     ✓ focuses search input when Cmd+K is pressed
     ✓ doesn't trigger shortcuts when typing in input
     ✓ switches search type when dropdown option is clicked
 ✓ src/components/SearchQuestionsList.test.tsx (5)
   ✓ SearchQuestionsList (5)
     ✓ renders search results correctly
     ✓ displays loading state
     ✓ displays error state
     ✓ displays empty state message when no results
     ✓ handles difficulty filter change
 ✓ src/components/Tag.test.tsx (5)
   ✓ Tag (5)
     ✓ renders tag information correctly
     ✓ shows 'See all questions' link
     ✓ shows create question link when authenticated
     ✓ does not show create question link when not authenticated
     ✓ renders image with correct alt and title attributes
 ✓ src/components/Tags.test.tsx (7)
   ✓ TagsPage (7)
     ✓ renders tags list correctly
     ✓ displays loading state
     ✓ displays error state
     ✓ shows create tag button
     ✓ loads more tags when scrolling
     ✓ handles empty tags list
     ✓ updates search results when query changes
 ✓ src/components/ui/tabs.test.tsx (3)
   ✓ Tabs Accessibility (3)
     ✓ should have no accessibility violations
     ✓ should be keyboard navigable
     ✓ should have proper ARIA attributes

 Test Files  25 passed (25)
      Tests  110 passed (110)
   Start at  16:17:05
   Duration  5.64s (transform 1.30s, setup 10.44s, collect 14.90s, tests 4.56s, environment 7.66s, prepare 1.74s)

Coverage Report from v8

The following is the coverage report from v8 for the frontend.


% Coverage report from v8
------------------------------|---------|----------|---------|---------|-------------------------------------------------------------------------------------------------------
File                          | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                                                                                     
------------------------------|---------|----------|---------|---------|-------------------------------------------------------------------------------------------------------
All files                     |   77.54 |    66.23 |   48.68 |   77.54 |                                                                                                       
src                          |       0 |        0 |       0 |       0 |                                                                                                       
 App.tsx                     |       0 |        0 |       0 |       0 | 1-23                                                                                                  
 main.tsx                    |       0 |        0 |       0 |       0 | 1-8                                                                                                   
src/components               |    76.8 |     72.1 |    57.3 |    76.8 |                                                                                                       
 AnswerCard.tsx              |     100 |      100 |     100 |     100 |                                                                                                       
 AnswerItem.tsx              |    87.5 |    33.33 |      50 |    87.5 | 88-95                                                                                                 
 Answers.tsx                 |      88 |    55.55 |      60 |      88 | 42-43,55-58                                                                                           
 BookmarkButton.tsx          |   58.33 |     12.5 |   16.66 |   58.33 | 32-35,37-38,42-45,47-48,60-75,78,80                                                                   
 CodeSnippet.tsx             |     100 |    85.71 |     100 |     100 | 42                                                                                                    
 ContentWithSnippets.tsx     |   55.73 |     62.5 |     100 |   55.73 | 24-46,61-68                                                                                           
 CreateAnswerForm.tsx        |    97.5 |    86.66 |     100 |    97.5 | 42-43                                                                                                 
 CreateTagForm.tsx           |     100 |      100 |     100 |     100 |                                                                                                       
 CreateTagPage.tsx           |   69.23 |      100 |      50 |   69.23 | 12-15                                                                                                 
 CustomAnchor.tsx            |     100 |      100 |     100 |     100 |                                                                                                       
 DifficultyBar.tsx           |   91.47 |       45 |     100 |   91.47 | 45-47,64-66,84-85,111,120,132                                                                         
 DifficultyFilter.tsx        |     100 |       75 |     100 |     100 | 21                                                                                                    
 ErrorAlert.tsx              |     100 |      100 |     100 |     100 |                                                                                                       
 ErrorBoundary.tsx           |   35.89 |    66.66 |      50 |   35.89 | 20-21,24-25,29-72                                                                                     
 ExerciseCard.tsx            |     100 |      100 |     100 |     100 |                                                                                                       
 FilterCheckbox.tsx          |   96.87 |       25 |     100 |   96.87 | 19                                                                                                    
 FollowButton.tsx            |    3.07 |      100 |       0 |    3.07 | 10-83                                                                                                 
 FullscreenLoading.tsx       |   95.83 |      100 |     100 |   95.83 | 14                                                                                                    
 HighlightedQuestionCard.tsx |    4.54 |      100 |       0 |    4.54 | 9-11,13-67                                                                                            
 HighlightedQuestionsBox.tsx |   17.64 |      100 |       0 |   17.64 | 8-28                                                                                                  
 InfiniteScroll.tsx          |   76.27 |    66.66 |      50 |   76.27 | 31-35,47-50,67-71,74                                                                                  
 NavbarLayout.tsx            |   96.19 |       75 |   66.66 |   96.19 | 102-104,133                                                                                           
 Profile.tsx                 |       0 |        0 |       0 |       0 | 1-23                                                                                                  
 QuestionCard.tsx            |     100 |      100 |     100 |     100 |                                                                                                       
 SearchBar.tsx               |    91.3 |    89.65 |   71.42 |    91.3 | 75-77,96-102                                                                                          
 SearchQuestionsList.tsx     |   97.36 |    66.66 |      50 |   97.36 | 54-55                                                                                                 
 SearchTagsList.tsx          |   96.55 |    86.66 |      50 |   96.55 | 53-54                                                                                                 
 SubtypeCard.tsx             |     100 |      100 |     100 |     100 |                                                                                                       
 Tag.tsx                     |     100 |       50 |     100 |     100 | 41                                                                                                    
 TagCard.tsx                 |     100 |      100 |     100 |     100 |                                                                                                       
 TagFollowButton.tsx         |    52.3 |    16.66 |   16.66 |    52.3 | 31-34,36-37,41-44,46-47,57-72,75,77,79                                                                
 TagType.tsx                 |    2.24 |      100 |       0 |    2.24 | 11-172                                                                                                
 Tags.tsx                    |   96.61 |    85.71 |      50 |   96.61 | 45-46                                                                                                 
 multi-select.tsx            |   78.36 |       75 |       0 |   78.36 | 84-96,99-101,104-105,108-111,114-121,157-159,174-176,185-187                                          
src/lib                      |     100 |      100 |     100 |     100 |                                                                                                       
 utils.ts                    |     100 |      100 |     100 |     100 |                                                                                                       
src/routes                   |   86.45 |    55.88 |   41.46 |   86.45 |                                                                                                       
 bookmarks.tsx               |   93.47 |    44.44 |     100 |   93.47 | 20-21,33                                                                                              
 create-question.tsx         |   87.62 |    91.66 |   28.57 |   87.62 | 111-120,175-182,269-279                                                                               
 feed.tsx                    |   84.07 |       10 |     100 |   84.07 | 67-74,91-94,115-118,154-157                                                                           
 glossary.tsx                |     100 |      100 |     100 |     100 |                                                                                                       
 home.tsx                    |     100 |      100 |     100 |     100 |                                                                                                       
 index.tsx                   |   95.83 |      100 |       0 |   95.83 | 39-41                                                                                                 
 login.tsx                   |   97.67 |       80 |     100 |   97.67 | 76-77                                                                                                 
 profile.tsx                 |   87.05 |    57.14 |      60 |   87.05 | 37-38,53-57,59-60,64-65,181-193                                                                       
 question.tsx                |   63.17 |    26.66 |    5.88 |   63.17 | ...,83-86,136-138,142-165,168-169,171-172,174-182,190-193,203-210,218,284-286,297-299,313-324,343-369 
 search.tsx                  |      90 |       75 |     100 |      90 | 10                                                                                                    
 signup.tsx                  |   98.33 |     87.5 |     100 |   98.33 | 105-107                                                                                               
 tag.tsx                     |   93.64 |    14.28 |     100 |   93.64 | 75-76,79-80,83-91                                                                                     
src/services                 |   81.54 |       80 |      30 |   81.54 |                                                                                                       
 auth.tsx                    |   84.84 |       80 |      75 |   84.84 | 26-28,50-51                                                                                           
 exercism.ts                 |   14.28 |      100 |       0 |   14.28 | 39-56,59-78,81-86                                                                                     
 query-client.ts             |   35.71 |      100 |       0 |   35.71 | 8-37                                                                                                  
 temporaryMocks.ts           |   95.87 |      100 |       0 |   95.87 | 3-11,13-17                                                                                            
src/services/api             |    16.1 |       75 |      25 |    16.1 |                                                                                                       
 programmingForumFetcher.ts  |    16.1 |       75 |      25 |    16.1 | 47-170,173-185,208-217                                                                                
src/utils                    |   44.44 |      100 |      20 |   44.44 |                                                                                                       
 test-accessibility.ts       |   44.44 |      100 |      20 |   44.44 | 7-17,20-31,34-38,41-45                                                                                
------------------------------|---------|----------|---------|---------|-------------------------------------------------------------------------------------------------------