72 lines
2.3 KiB
TypeScript
72 lines
2.3 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 = {
|
|
url: 'https://nhentai.net/g/117300/',
|
|
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',
|
|
],
|
|
languages: ['english', 'translated'],
|
|
uploadTime: 1411853968970,
|
|
};
|
|
let gallery = await nhentaiAppWindow.getGallery('117300');
|
|
expect(gallery).deep.equalInAnyOrder(expectedGallery, 'Renai Sample is not got correctly');
|
|
|
|
expectedGallery = {
|
|
url: 'https://nhentai.net/g/273405/',
|
|
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'],
|
|
languages: ['english', 'translated'],
|
|
uploadTime: 1558833881932,
|
|
};
|
|
gallery = await nhentaiAppWindow.getGallery('273405');
|
|
expect(gallery).deep.equalInAnyOrder(expectedGallery, 'The Archdemon in Love is not got correctly!');
|
|
}).timeout(0);
|
|
});
|