diff options
| author | stonedDiscord <Tukz@gmx.de> | 2023-09-20 13:10:36 +0200 |
|---|---|---|
| committer | stonedDiscord <Tukz@gmx.de> | 2023-09-20 13:10:36 +0200 |
| commit | dda92bd41f4bee11e2cc5de265ce4fbf5221f1ff (patch) | |
| tree | bcb0f8121955ff815758b30ec4e24a1e6bde4fba /webAO/client/__tests__/setEmote.test.js | |
| parent | 59028dd4046ad0715d80be8d1ed0031f20f05b7a (diff) | |
autoformat with eslint
Diffstat (limited to 'webAO/client/__tests__/setEmote.test.js')
| -rw-r--r-- | webAO/client/__tests__/setEmote.test.js | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/webAO/client/__tests__/setEmote.test.js b/webAO/client/__tests__/setEmote.test.js index 829c94d..a0091c0 100644 --- a/webAO/client/__tests__/setEmote.test.js +++ b/webAO/client/__tests__/setEmote.test.js @@ -9,104 +9,104 @@ jest.mock('../../viewport/utils/createSfxAudio'); jest.mock('../../viewport/utils/createShoutAudio'); jest.mock('../../viewport/utils/createTestimonyAudio'); describe('setEmote', () => { - const AO_HOST = ''; + const AO_HOST = ''; - const client = new Client('127.0.0.1'); - const firstExtension = '.gif'; + 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 = ` + 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 = ` + 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 = ` + 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}`; + 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 = ` + 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}`; + 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 = ` + 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}`; + 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 = ` + 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}`; + 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 = ` + 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}`; + 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 = ` + 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}`; + 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 = ` + 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'; + 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 = ` + 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); - }); + await setEmote(AO_HOST, client, 'salanto', 'coding', 'prefixNotValid', 1, 'notvalid'); + const expected = transparentPng; + expect(document.getElementById('client_pair_img').src).toEqual(expected); + }); }); |
