RenaiApp/src/main/modules/nhentai/nhentai-app-window.spec.ts

66 lines
2.1 KiB
TypeScript

import chai, { expect } from 'chai';
import deepEqualInAnyOrder from 'deep-equal-in-any-order';
import { describe, it, before } from 'mocha';
import { container } from '../../core/container';
import { LoggerMock } from '../logger/logger.mock';
import type { NhentaiAppWindowInterface } from './nhentai-app-window-interface';
chai.use(deepEqualInAnyOrder);
describe('Nhentai App Window', () => {
before(() => {
container.unbind('logger');
container.bind('logger').to(LoggerMock);
});
it('gets the gallery information from an identifier @slow', async () => {
const nhentaiAppWindow: NhentaiAppWindowInterface = container.get('nhentai-app-window');
let expectedGallery: Nhentai.Gallery = {
title: {
pre: '[Homunculus]',
main: 'Renai Sample',
post: '[English] [Decensored]',
},
artists: ['homunculus'],
groups: [],
parodies: [],
characters: [],
tags: [
'group',
'stockings',
'schoolgirl uniform',
'glasses',
'nakadashi',
'incest',
'tankoubon',
'defloration',
'swimsuit',
'ffm threesome',
'sister',
'schoolboy uniform',
'bikini',
'uncensored',
'small breasts',
],
};
let gallery = await nhentaiAppWindow.getGallery('117300');
expect(gallery).deep.equalInAnyOrder(expectedGallery, 'Renai Sample is not got correctly');
expectedGallery = {
title: {
pre: '(COMIC1☆12) [MOSQUITONE. (Great Mosu)]',
main: 'Koisuru Dai Akuma | The Archdemon In Love',
post: '(Gabriel DropOut) [English] {Tanjoubi + Hennojin} [Decensored]',
},
artists: ['great mosu'],
groups: ['mosquitone.'],
parodies: ['gabriel dropout'],
characters: ['satanichia kurumizawa mcdowell'],
tags: ['sole female', 'sole male', 'defloration', 'uncensored', 'kissing'],
};
gallery = await nhentaiAppWindow.getGallery('273405');
expect(gallery).deep.equalInAnyOrder(expectedGallery, 'The Archdemon in Love is not got correctly!');
}).timeout(0);
});