Skip to content

Commit 96de464

Browse files
committed
add test for loading extensions
1 parent 88c436a commit 96de464

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

test/e2e/components/Application.test.tsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Application as PixiApplication } from 'pixi.js';
1+
import { Application as PixiApplication, extensions as PixiExtensions, ExtensionType } from 'pixi.js';
22
import {
33
createContext,
44
createRef,
@@ -195,4 +195,24 @@ describe('Application', () =>
195195
expect(roots.size).toEqual(0);
196196
});
197197
});
198+
199+
it('loads extensions provided in the extensions prop', async () =>
200+
{
201+
const customLoader = {
202+
extension: {
203+
type: ExtensionType.LoadParser,
204+
name: 'custom-loader',
205+
priority: 100,
206+
},
207+
};
208+
209+
const addSpy = vi.spyOn(PixiExtensions, 'add');
210+
211+
await act(async () => render((
212+
<Application extensions={[customLoader]} />
213+
)));
214+
215+
expect(addSpy).toHaveBeenCalledWith(customLoader);
216+
addSpy.mockRestore();
217+
});
198218
});

0 commit comments

Comments
 (0)