mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00
* feat: team permission refine (#4402) * chore: team permission extend * feat: manage team permission * chore: api auth * fix: i18n * feat: add initv493 * fix: test, org auth manager * test: app test for refined permission * update init sh * fix: add/remove manage permission (#4427) * fix: add/remove manage permission * fix: github action fastgpt-test * fix: mock create model * fix: team write permission * fix: ts * account permission --------- Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
import { MongoApp } from '@fastgpt/service/core/app/schema';
|
||||
import { MongoAppVersion } from '@fastgpt/service/core/app/version/schema';
|
||||
import { getRootUser } from '@test/datas/users';
|
||||
import { Call } from '@test/utils/request';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import handler, {
|
||||
type versionListBody,
|
||||
type versionListResponse
|
||||
} from '@/pages/api/core/app/version/list';
|
||||
|
||||
describe('app version list test', () => {
|
||||
it('should return app version list', async () => {
|
||||
const root = await getRootUser();
|
||||
const app = await MongoApp.create({
|
||||
name: 'test',
|
||||
tmbId: root.tmbId,
|
||||
teamId: root.teamId
|
||||
});
|
||||
await MongoAppVersion.create(
|
||||
[...Array(10).keys()].map((i) => ({
|
||||
tmbId: root.tmbId,
|
||||
appId: app._id,
|
||||
versionName: `v${i}`
|
||||
}))
|
||||
);
|
||||
const res = await Call<versionListBody, {}, versionListResponse>(handler, {
|
||||
auth: root,
|
||||
body: {
|
||||
pageSize: 10,
|
||||
offset: 0,
|
||||
appId: app._id
|
||||
}
|
||||
});
|
||||
expect(res.code).toBe(200);
|
||||
expect(res.data.total).toBe(10);
|
||||
expect(res.data.list.length).toBe(10);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user