diff options
| author | stonedDiscord <Tukz@gmx.de> | 2026-01-01 16:56:51 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-01 16:56:51 +0100 |
| commit | 33744e44ceaf3825da451ba38281fd84b255de80 (patch) | |
| tree | e6c080d7e8e6f56652c2269a380eff40b899a065 /webAO/__tests__/setEmote.test.js | |
| parent | e07fe372bc20d16eb590b68ed256007312b3801a (diff) | |
| parent | 01ecb948edb015613e05bc2b6da4021137957745 (diff) | |
Merge pull request #286 from AttorneyOnline/bnnuy
Bnnuy
Diffstat (limited to 'webAO/__tests__/setEmote.test.js')
| -rw-r--r-- | webAO/__tests__/setEmote.test.js | 140 |
1 files changed, 0 insertions, 140 deletions
diff --git a/webAO/__tests__/setEmote.test.js b/webAO/__tests__/setEmote.test.js deleted file mode 100644 index 3a4a521..0000000 --- a/webAO/__tests__/setEmote.test.js +++ /dev/null @@ -1,140 +0,0 @@ -import setEmote from "../client/setEmote.ts"; -import Client from "../client.ts"; -import fileExists from "../utils/fileExists.ts"; -import transparentPng from "../constants/transparentPng.js"; - -jest.mock("../viewport/utils/createMusic"); -jest.mock("../utils/fileExists"); -jest.mock("../viewport/utils/createSfxAudio"); -jest.mock("../viewport/utils/createShoutAudio"); -jest.mock("../viewport/utils/createTestimonyAudio"); -describe("setEmote", () => { - const AO_HOST = ""; - - const client = new Client("127.0.0.1"); - const firstExtension = ".gif"; - - test("Should have a client_def_char_img with a valid source", async () => { - fileExists.mockReturnValue(true); - document.body.innerHTML = ` - <img id="client_def_char_img" /> - `; - await setEmote(AO_HOST, client, "salanto", "coding", "(a)", 0, "def"); - const expected = `http://localhost/characters/salanto/(a)coding${firstExtension}`; - expect(document.getElementById("client_def_char_img").src).toEqual( - expected, - ); - }); - test("Should have a client_pro_char_img to have a valid src", async () => { - document.body.innerHTML = ` - <img id="client_pro_char_img" /> - - `; - await setEmote(AO_HOST, client, "salanto", "coding", "(a)", 0, "pro"); - const expected = `http://localhost/characters/salanto/(a)coding${firstExtension}`; - expect(document.getElementById("client_pro_char_img").src).toEqual( - expected, - ); - }); - test("Should have a client_wit_char_img", async () => { - document.body.innerHTML = ` - <img id="client_wit_char_img" /> - `; - await setEmote(AO_HOST, client, "salanto", "coding", "(a)", 0, "wit"); - const expected = `http://localhost/characters/salanto/(a)coding${firstExtension}`; - - expect(document.getElementById("client_wit_char_img").src).toEqual( - expected, - ); - }); - test("Should have a client_def_pair_img", async () => { - document.body.innerHTML = ` -<img id="client_def_pair_img" /> - -`; - await setEmote(AO_HOST, client, "salanto", "coding", "(a)", 1, "def"); - const expected = `http://localhost/characters/salanto/(a)coding${firstExtension}`; - - expect(document.getElementById("client_def_pair_img").src).toEqual( - expected, - ); - }); - test("Should have a client_pro_pair_img", async () => { - document.body.innerHTML = ` -<img id="client_pro_pair_img" /> - -`; - await setEmote(AO_HOST, client, "salanto", "coding", "(a)", 1, "pro"); - const expected = `http://localhost/characters/salanto/(a)coding${firstExtension}`; - - expect(document.getElementById("client_pro_pair_img").src).toEqual( - expected, - ); - }); - test("Should have a client_wit_pair_img", async () => { - document.body.innerHTML = ` -<img id="client_wit_pair_img" /> - -`; - await setEmote(AO_HOST, client, "salanto", "coding", "(a)", 1, "wit"); - const expected = `http://localhost/characters/salanto/(a)coding${firstExtension}`; - - expect(document.getElementById("client_wit_pair_img").src).toEqual( - expected, - ); - }); - test("Should have a client_char_img", async () => { - document.body.innerHTML = ` - <img id="client_char_img" /> - - `; - await setEmote(AO_HOST, client, "salanto", "coding", "(a)", 0, "notvalid"); - const expected = `http://localhost/characters/salanto/(a)coding${firstExtension}`; - - expect(document.getElementById("client_char_img").src).toEqual(expected); - }); - test("Should have a client_pair_img", async () => { - document.body.innerHTML = ` - <img id="client_pair_img" /> - `; - await setEmote(AO_HOST, client, "salanto", "coding", "(a)", 1, "notvalid"); - const expected = `http://localhost/characters/salanto/(a)coding${firstExtension}`; - - expect(document.getElementById("client_pair_img").src).toEqual(expected); - }); - test("Should handle .png urls differently", async () => { - fileExists.mockReturnValueOnce(false); - document.body.innerHTML = ` - <img id="client_pair_img" /> - `; - await setEmote( - AO_HOST, - client, - "salanto", - "coding", - "prefixNotValid", - 1, - "notvalid", - ); - const expected = "http://localhost/characters/salanto/coding.png"; - - expect(document.getElementById("client_pair_img").src).toEqual(expected); - }); - test("Should replace character if new character responds", async () => { - fileExists.mockReturnValue(false); - document.body.innerHTML = ` - <img id="client_pair_img" /> - `; - await setEmote( - AO_HOST, - client, - "salanto", - "coding", - "prefixNotValid", - 1, - "notvalid", - ); - const expected = transparentPng; - expect(document.getElementById("client_pair_img").src).toEqual(expected); - }); -}); |
