mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
feat: struct type feature config (#5142)
This commit is contained in:
@@ -4,6 +4,7 @@ import ava, { type TestFn } from 'ava';
|
||||
import { stub } from 'sinon';
|
||||
|
||||
import { AppModule } from '../src/app';
|
||||
import { FeatureManagementService } from '../src/modules/features';
|
||||
import { Quotas } from '../src/modules/quota';
|
||||
import { UsersService } from '../src/modules/users';
|
||||
import { PermissionService } from '../src/modules/workspaces/permission';
|
||||
@@ -59,6 +60,23 @@ test.beforeEach(async t => {
|
||||
};
|
||||
},
|
||||
},
|
||||
features: {
|
||||
async findFirst() {
|
||||
return {
|
||||
id: 0,
|
||||
feature: 'free_plan_v1',
|
||||
version: 1,
|
||||
type: 1,
|
||||
configs: {
|
||||
name: 'Free',
|
||||
blobLimit: 1,
|
||||
storageQuota: 1,
|
||||
historyPeriod: 1,
|
||||
memberLimit: 3,
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
})
|
||||
.overrideProvider(PermissionService)
|
||||
.useClass(FakePermission)
|
||||
@@ -70,6 +88,8 @@ test.beforeEach(async t => {
|
||||
return 1024 * 10;
|
||||
},
|
||||
})
|
||||
.overrideProvider(FeatureManagementService)
|
||||
.useValue({})
|
||||
.compile();
|
||||
t.context.app = module.createNestApplication();
|
||||
t.context.resolver = t.context.app.get(WorkspaceResolver);
|
||||
|
||||
Reference in New Issue
Block a user