11import { render , screen , fireEvent } from '@testing-library/preact' ;
22import { describe , it , expect , vi , beforeEach } from 'vitest' ;
3- import * as NavbarModule from './Navbar' ;
4- import { connected as connectedSignal } from './Navbar' ;
3+ import * as NavbarModule from '.. /Navbar' ;
4+ import { connected as connectedSignal } from '.. /Navbar' ;
55import { useLocation } from 'preact-iso' ;
6- import { fetchClient , AppState , loggedIn , bc , resetSecret , clearSecretKeyFromServiceWorker } from '../utils' ;
6+ import { fetchClient , AppState , loggedIn , bc , resetSecret , clearSecretKeyFromServiceWorker } from '../../ utils' ;
77
88// Use actual module for component and functions (test-setup re-exports actual)
99const { CustomNavbar } = NavbarModule ;
@@ -54,7 +54,7 @@ describe('Navbar', () => {
5454 ( fetchClient . GET as unknown as ReturnType < typeof vi . fn > ) . mockReset ( ) ;
5555 ( fetchClient . GET as unknown as ReturnType < typeof vi . fn > ) . mockResolvedValueOnce ( { error : undefined } ) ;
5656
57- const actual = await vi . importActual < typeof import ( './Navbar' ) > ( './Navbar' ) ;
57+ const actual = await vi . importActual < typeof import ( '.. /Navbar' ) > ( '. ./Navbar' ) ;
5858 await actual . logout ( false ) ;
5959
6060 // Assert
@@ -69,10 +69,10 @@ describe('Navbar', () => {
6969 it ( 'logout() shows alert when logout_all fails' , async ( ) => {
7070 ( fetchClient . GET as unknown as ReturnType < typeof vi . fn > ) . mockReset ( ) ;
7171 ( fetchClient . GET as unknown as ReturnType < typeof vi . fn > ) . mockResolvedValueOnce ( { error : 'boom' } ) ;
72- const { showAlert } = await vi . importMock < typeof import ( './Alert' ) > ( './Alert' ) ;
72+ const { showAlert } = await vi . importMock < typeof import ( '.. /Alert' ) > ( '. ./Alert' ) ;
7373 const showAlertSpy = showAlert as unknown as ReturnType < typeof vi . fn > ;
7474
75- const actual = await vi . importActual < typeof import ( './Navbar' ) > ( './Navbar' ) ;
75+ const actual = await vi . importActual < typeof import ( '.. /Navbar' ) > ( '. ./Navbar' ) ;
7676 await actual . logout ( true ) ;
7777
7878 // Assert
@@ -83,7 +83,7 @@ describe('Navbar', () => {
8383 it ( 'setAppNavigation configures sidebar via Median' , async ( ) => {
8484 const Median = await vi . importMock < typeof import ( 'median-js-bridge' ) > ( 'median-js-bridge' ) ;
8585 const setItems = vi . spyOn ( Median . default . sidebar , 'setItems' ) ;
86- const mod = await vi . importActual < typeof import ( './Navbar' ) > ( './Navbar' ) ;
86+ const mod = await vi . importActual < typeof import ( '.. /Navbar' ) > ( '. ./Navbar' ) ;
8787 mod . setAppNavigation ( ) ;
8888 expect ( setItems ) . toHaveBeenCalled ( ) ;
8989 } ) ;
0 commit comments