File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,9 @@ import React from "react";
55import userEvent from "@testing-library/user-event" ;
66import { IResponse } from "./types/speakers" ;
77import axios , { AxiosHeaders , AxiosResponse } from "axios" ;
8+ import { vi } from "vitest" ;
89
9- jest . mock ( "axios" ) ;
10+ vi . mock ( "axios" ) ;
1011const mockedAxios = axios as jest . Mocked < typeof axios > ;
1112const axiosHeaders = new AxiosHeaders ( ) ;
1213const payload : AxiosResponse < IResponse [ ] > = {
@@ -67,11 +68,11 @@ const payload: AxiosResponse<IResponse[]> = {
6768
6869describe ( "navigation pages" , ( ) => {
6970 beforeAll ( ( ) => {
70- jest . mock ( "axios" ) ;
71+ vi . mock ( "axios" ) ;
7172 mockedAxios . get . mockImplementation ( ( ) => Promise . resolve ( payload ) ) ;
7273 } ) ;
7374 beforeEach ( ( ) => {
74- jest . clearAllMocks ( ) ;
75+ vi . clearAllMocks ( ) ;
7576 } ) ;
7677
7778 test ( "it render the HOME page" , async ( ) => {
@@ -164,7 +165,6 @@ describe("navigation pages", () => {
164165 ).not.toBeInTheDocument();*/
165166 } ) ;
166167
167- //Reason: not enabled yet
168168 test ( "it render the CFP page" , async ( ) => {
169169 render (
170170 < React . Suspense fallback = { < span > Loading...</ span > } >
Original file line number Diff line number Diff line change @@ -50,15 +50,15 @@ const Talks: FC<React.PropsWithChildren<unknown>> = () => {
5050 useSentryErrorReport ( error ) ;
5151
5252 const removeParenthesesContent = ( text : string ) : string => {
53- return text . replace ( / \s * \( [ ^ ) ] * \) / g, "" ) ;
53+ return text ? .replace ( / \s * \( [ ^ ) ] * \) / g, "" ) ;
5454 } ;
5555
5656 const trackOptions = [
5757 { name : "All Tracks" , code : undefined } ,
5858 ...( data !== undefined
5959 ? data
6060 . flatMap ( ( group ) => ( {
61- code : group . groupId . toString ( ) ,
61+ code : group ? .groupId ? .toString ( ) ,
6262 name : removeParenthesesContent ( group . groupName ) ,
6363 } ) )
6464 . sort ( ( a , b ) => a . name . localeCompare ( b . name ) )
You can’t perform that action at this time.
0 commit comments