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';
|
2022-01-15 03:57:20 +08:00
|
|
|
import {ParentDirectoryDTO} from '../../../../../src/common/entities/DirectoryDTO';
|
|
|
|
import {Connection} from 'typeorm';
|
2019-01-28 03:36:42 +08:00
|
|
|
|
2022-12-05 05:23:51 +08:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
2022-01-15 03:57:20 +08:00
|
|
|
const deepEqualInAnyOrder = require('deep-equal-in-any-order');
|
2022-12-05 05:23:51 +08:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
2022-01-15 03:57:20 +08:00
|
|
|
const chai = require('chai');
|
|
|
|
|
|
|
|
chai.use(deepEqualInAnyOrder);
|
|
|
|
const {expect} = chai;
|
2019-01-28 03:36:42 +08:00
|
|
|
|
|
|
|
// to help WebStorm to handle the test cases
|
|
|
|
declare let describe: any;
|
2022-01-15 03:57:20 +08:00
|
|
|
declare const before: any;
|
2019-01-28 03:36:42 +08:00
|
|
|
declare const after: any;
|
2022-01-15 03:57:20 +08:00
|
|
|
const tmpDescribe = describe;
|
2021-04-02 03:48:38 +08:00
|
|
|
describe = DBTestHelper.describe();
|
2019-01-28 03:36:42 +08:00
|
|
|
|
2022-01-15 03:57:20 +08:00
|
|
|
|
|
|
|
class GalleryManagerTest extends GalleryManager {
|
|
|
|
|
2022-12-05 05:23:51 +08:00
|
|
|
public async getDirIdAndTime(connection: Connection, directoryName: string, directoryParent: string) {
|
|
|
|
return super.getDirIdAndTime(connection, directoryName, directoryParent);
|
2022-01-15 03:57:20 +08:00
|
|
|
}
|
|
|
|
|
2022-12-05 05:23:51 +08:00
|
|
|
public async getParentDirFromId(connection: Connection, dir: number): Promise<ParentDirectoryDTO> {
|
|
|
|
return super.getParentDirFromId(connection, dir);
|
2022-01-15 03:57:20 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-02 03:48:38 +08:00
|
|
|
describe('GalleryManager', (sqlHelper: DBTestHelper) => {
|
2022-01-15 03:57:20 +08:00
|
|
|
describe = tmpDescribe;
|
|
|
|
|
2019-01-28 03:36:42 +08:00
|
|
|
});
|