From f362bc0272b6b2ba76421aa1cc0ab306718bbdeb Mon Sep 17 00:00:00 2001 From: Jomshir98 Date: Mon, 9 Oct 2023 22:46:52 +0200 Subject: [PATCH] [FIX] Remove old tests --- .../src/assets/graphicsLoader.ts | 5 ++- .../test/asset/graphicsLoader.test.ts | 42 ------------------- 2 files changed, 4 insertions(+), 43 deletions(-) delete mode 100644 pandora-client-web/test/asset/graphicsLoader.test.ts diff --git a/pandora-client-web/src/assets/graphicsLoader.ts b/pandora-client-web/src/assets/graphicsLoader.ts index 6258af011f..f71dd57dc7 100644 --- a/pandora-client-web/src/assets/graphicsLoader.ts +++ b/pandora-client-web/src/assets/graphicsLoader.ts @@ -1,8 +1,11 @@ import { Assert, GetLogger, Logger } from 'pandora-common'; -import { BaseTexture, IImageResourceOptions, Resource, Texture, autoDetectResource } from 'pixi.js'; +import { BaseTexture, IImageResourceOptions, Resource, Texture, autoDetectResource, settings as PIXISettings } from 'pixi.js'; import { PersistentToast } from '../persistentToast'; import { IGraphicsLoader } from './graphicsManager'; +// Prevent PIXI from doing PIXI things +PIXISettings.STRICT_TEXTURE_CACHE = true; + /** * Interval after which texture load is retried, if the texture is still being requested. * Last interval is repeated indefinitely until the load either succeeds or the texture is no longer needed. diff --git a/pandora-client-web/test/asset/graphicsLoader.test.ts b/pandora-client-web/test/asset/graphicsLoader.test.ts deleted file mode 100644 index d8c45697b9..0000000000 --- a/pandora-client-web/test/asset/graphicsLoader.test.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { GetLogger } from 'pandora-common'; -import { Texture, Resource } from 'pixi.js'; -import { GraphicsLoaderBase } from '../../src/assets/graphicsLoader'; - -describe('GraphicsLoaderBase', () => { - const mockGraphicsLoaderBase = new class MockGraphicsLoaderBase extends GraphicsLoaderBase { - constructor() { - super(GetLogger('GraphicsLoader')); - } - - protected loadTexture(_path: string): Promise> { - throw new Error('Method not implemented.'); - } - - public loadTextFile(_path: string): Promise { - throw new Error('Method not implemented.'); - } - public loadFileArrayBuffer(_path: string): Promise { - throw new Error('Method not implemented.'); - } - public pathToUrl(_path: string): Promise { - throw new Error('Method not implemented.'); - } - }; - - describe('async getTexture()', () => { - it('should return Texture.EMPTY', async () => { - expect(await mockGraphicsLoaderBase.getTexture('')).toBe(Texture.EMPTY); - }); - }); -}); - -describe('URLGraphicsLoader', () => { - - describe('loadTextureFile()', () => { - it.todo('should fetch texture file'); // fetch is not in jsdom - }); - - describe('loadFileArrayBuffer', () => { - it.todo('load to array buffer'); - }); -});