feat: struct type feature config (#5142)

This commit is contained in:
DarkSky
2023-12-14 09:50:51 +00:00
parent 2b7f6f8b74
commit 0c2d2f8d16
33 changed files with 1223 additions and 1015 deletions

View File

@@ -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);