From f6263034995210de7a493eeaf097c2885423ae5d Mon Sep 17 00:00:00 2001 From: Clement Balea Date: Tue, 25 Jun 2024 23:01:29 +0200 Subject: [PATCH] Fix/get image extension (#59) * add getImageExtension * eof --- setup.js | 7 +++++++ tests/setup.test.js | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/setup.js b/setup.js index d724cec..fcecf93 100644 --- a/setup.js +++ b/setup.js @@ -5,11 +5,18 @@ if(!window.WOTLK_TO_RETAIL_DISPLAY_ID_API){ window.WOTLK_TO_RETAIL_DISPLAY_ID_API=`https://wotlk.murlocvillage.com/api/items` } +class WebP { + getImageExtension() { + return `.webp` + } + +} if (!window.WH) { window.WH = {} window.WH.debug = function (...args) { console.log(args) } window.WH.defaultAnimation = `Stand` + window.WH.WebP = new WebP() window.WH.Wow = { Item: { INVENTORY_TYPE_HEAD: 1, diff --git a/tests/setup.test.js b/tests/setup.test.js index 8aff1ba..60288ab 100644 --- a/tests/setup.test.js +++ b/tests/setup.test.js @@ -8,7 +8,12 @@ describe(`WH`, () => { expect(window.WOTLK_TO_RETAIL_DISPLAY_ID_API).toEqual(`https://wotlk.murlocvillage.com/api/items`) expect(window.CONTENT_PATH).toEqual(`http://localhost:3001/modelviewer/live/`) }) - it(`check consts WH.debug`, async () => { + + it(`check function WH.debug`, async () => { WH.debug(`Hello`, `world`) }) -}) \ No newline at end of file + + it(`check method WH.WebP.getImageExtension`, async () => { + expect(expect(WH.WebP.getImageExtension()).toEqual(`.webp`)) + }) +})