fix(plugin-collection-manager): test error

This commit is contained in:
chenos 2022-01-24 11:46:10 +08:00
parent 2a2d67e38b
commit b398e65c9c
3 changed files with 73 additions and 1 deletions

View File

@ -58,7 +58,7 @@ describe('collections repository', () => {
timestamps: true, timestamps: true,
}); });
const [updated] = await Collection.repository.update({ const [updated] = await Collection.repository.update({
filterByTk: data.get('key') as any, filterByTk: data.get('name') as any,
values: { values: {
createdBy: false, createdBy: false,
updatedBy: false, updatedBy: false,

View File

@ -0,0 +1,36 @@
import Database, { Collection as DBCollection } from '@nocobase/database';
import Application from '@nocobase/server';
import { createApp } from '..';
describe('belongsTo', () => {
let db: Database;
let app: Application;
let Collection: DBCollection;
let Field: DBCollection;
beforeEach(async () => {
app = await createApp();
await app.db.sync();
db = app.db;
Collection = db.getCollection('collections');
Field = db.getCollection('fields');
await Collection.repository.create({
values: {
name: 'tests',
},
});
await Collection.repository.create({
values: {
name: 'foos',
},
});
});
afterEach(async () => {
await app.destroy();
});
it('a', () => {
expect(true).toBe(true);
});
});

View File

@ -0,0 +1,36 @@
import Database, { Collection as DBCollection } from '@nocobase/database';
import Application from '@nocobase/server';
import { createApp } from '..';
describe('belongsToMany', () => {
let db: Database;
let app: Application;
let Collection: DBCollection;
let Field: DBCollection;
beforeEach(async () => {
app = await createApp();
await app.db.sync();
db = app.db;
Collection = db.getCollection('collections');
Field = db.getCollection('fields');
await Collection.repository.create({
values: {
name: 'tests',
},
});
await Collection.repository.create({
values: {
name: 'foos',
},
});
});
afterEach(async () => {
await app.destroy();
});
it('a', () => {
expect(true).toBe(true);
});
});