11import { beforeEach , describe , expect , it , jest } from '@jest/globals'
2- import { namedNode } from 'rdflib'
2+ import { namedNode , type NamedNode } from 'rdflib'
33import { authSession , authn } from 'solid-logic'
44import { PeopleSearch } from './PeopleSearch'
5- import './index'
65import ns from '../../../../ns'
76
87jest . mock ( '@solid-data-modules/contacts-rdflib' , ( ) => ( {
@@ -32,6 +31,10 @@ const mockCurrentUser = authn.currentUser as jest.Mock
3231const mockOn = authSession . events . on as jest . Mock
3332const mockOff = authSession . events . off as jest . Mock
3433
34+ if ( ! customElements . get ( 'solid-ui-people-search' ) ) {
35+ customElements . define ( 'solid-ui-people-search' , PeopleSearch )
36+ }
37+
3538function getPortalRoot ( ) {
3639 const portalHost = document . querySelector ( '[data-solid-ui-combobox-portal]' ) as HTMLDivElement | null
3740 return portalHost ?. shadowRoot ?? null
@@ -49,7 +52,7 @@ describe('SolidUIPeopleSearch', () => {
4952 mockCurrentUser . mockReset ( )
5053 mockOn . mockReset ( )
5154 mockOff . mockReset ( )
52- ; ( globalThis as typeof globalThis & { fetch ?: typeof fetch } ) . fetch = undefined
55+ Reflect . deleteProperty ( globalThis , ' fetch' )
5356 } )
5457
5558 it ( 'is defined as a custom element' , ( ) => {
0 commit comments