mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-15 09:06:19 +08:00
refactor(server): use feature model (#9932)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { TestingModule } from '@nestjs/testing';
|
||||
import type { Snapshot } from '@prisma/client';
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
import test from 'ava';
|
||||
@@ -7,7 +6,7 @@ import * as Sinon from 'sinon';
|
||||
import { DocStorageModule, PgWorkspaceDocStorageAdapter } from '../../core/doc';
|
||||
import { DocStorageOptions } from '../../core/doc/options';
|
||||
import { DocRecord } from '../../core/doc/storage';
|
||||
import { createTestingModule, initTestingDB } from '../utils';
|
||||
import { createTestingModule, type TestingModule } from '../utils';
|
||||
|
||||
let m: TestingModule;
|
||||
let adapter: PgWorkspaceDocStorageAdapter;
|
||||
@@ -24,7 +23,7 @@ test.before(async () => {
|
||||
});
|
||||
|
||||
test.beforeEach(async () => {
|
||||
await initTestingDB(db);
|
||||
await m.initTestingDB();
|
||||
const options = m.get(DocStorageOptions);
|
||||
Sinon.stub(options, 'historyMaxAge').resolves(1000);
|
||||
});
|
||||
|
||||
@@ -75,7 +75,8 @@ test('should render correct html', async t => {
|
||||
);
|
||||
});
|
||||
|
||||
test('should render correct mobile html', async t => {
|
||||
// TODO(@forehalo): enable it when mobile version is ready
|
||||
test.skip('should render correct mobile html', async t => {
|
||||
const res = await request(t.context.app.getHttpServer())
|
||||
.get('/workspace/xxxx/xxx')
|
||||
.set('user-agent', mobileUAString)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { TestingModule } from '@nestjs/testing';
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
import test from 'ava';
|
||||
import * as Sinon from 'sinon';
|
||||
@@ -9,7 +8,7 @@ import {
|
||||
DocStorageModule,
|
||||
PgWorkspaceDocStorageAdapter as Adapter,
|
||||
} from '../../core/doc';
|
||||
import { createTestingModule, initTestingDB } from '../utils';
|
||||
import { createTestingModule, type TestingModule } from '../utils';
|
||||
|
||||
let m: TestingModule;
|
||||
let db: PrismaClient;
|
||||
@@ -35,7 +34,7 @@ test.before('init testing module', async () => {
|
||||
});
|
||||
|
||||
test.beforeEach(async () => {
|
||||
await initTestingDB(db);
|
||||
await m.initTestingDB();
|
||||
});
|
||||
|
||||
test.after.always(async () => {
|
||||
|
||||
Reference in New Issue
Block a user