1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/test/backend/unit/model/sql/GalleryManager.spec.ts

37 lines
1.2 KiB
TypeScript
Raw Normal View History

2021-04-02 03:48:38 +08:00
import {DBTestHelper} from '../../../DBTestHelper';
2023-01-06 06:11:58 +08:00
import {GalleryManager} from '../../../../../src/backend/model/database/GalleryManager';
import {ParentDirectoryDTO} from '../../../../../src/common/entities/DirectoryDTO';
import {Connection} from 'typeorm';
// eslint-disable-next-line @typescript-eslint/no-var-requires
const deepEqualInAnyOrder = require('deep-equal-in-any-order');
// eslint-disable-next-line @typescript-eslint/no-var-requires
const chai = require('chai');
chai.use(deepEqualInAnyOrder);
const {expect} = chai;
// to help WebStorm to handle the test cases
declare let describe: any;
declare const before: any;
declare const after: any;
const tmpDescribe = describe;
2021-04-02 03:48:38 +08:00
describe = DBTestHelper.describe();
class GalleryManagerTest extends GalleryManager {
public async getDirIdAndTime(connection: Connection, directoryName: string, directoryParent: string) {
return super.getDirIdAndTime(connection, directoryName, directoryParent);
}
public async getParentDirFromId(connection: Connection, dir: number): Promise<ParentDirectoryDTO> {
return super.getParentDirFromId(connection, dir);
}
}
2021-04-02 03:48:38 +08:00
describe('GalleryManager', (sqlHelper: DBTestHelper) => {
describe = tmpDescribe;
});