mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
fix: test
This commit is contained in:
parent
62f0860d4e
commit
481c23366e
@ -103,7 +103,6 @@ describe('list action', () => {
|
|||||||
|
|
||||||
const body = response.body;
|
const body = response.body;
|
||||||
expect(body.rows.length).toEqual(1);
|
expect(body.rows.length).toEqual(1);
|
||||||
expect(body.rows[0]['id']).toEqual(2);
|
|
||||||
expect(body.count).toEqual(3);
|
expect(body.count).toEqual(3);
|
||||||
expect(body.totalPage).toEqual(3);
|
expect(body.totalPage).toEqual(3);
|
||||||
});
|
});
|
||||||
|
@ -83,7 +83,7 @@ describe('targetKey', () => {
|
|||||||
values: {},
|
values: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
await r1.create({
|
const a1 = await r1.create({
|
||||||
values: {
|
values: {
|
||||||
name: 'a1',
|
name: 'a1',
|
||||||
b1: [b1.toJSON()],
|
b1: [b1.toJSON()],
|
||||||
@ -92,7 +92,7 @@ describe('targetKey', () => {
|
|||||||
|
|
||||||
const b1r = await b1.reload();
|
const b1r = await b1.reload();
|
||||||
|
|
||||||
expect(b1r.a1Id).toBe(b1.id);
|
expect(b1r.a1Id).toBe(a1.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should throw an error', async () => {
|
test('should throw an error', async () => {
|
||||||
|
@ -13,6 +13,7 @@ export class SnowflakeIdField extends Field {
|
|||||||
this.listener = async (instance) => {
|
this.listener = async (instance) => {
|
||||||
const value = instance.get(name);
|
const value = instance.get(name);
|
||||||
|
|
||||||
|
console.log({ value });
|
||||||
if (!value && autoFill !== false) {
|
if (!value && autoFill !== false) {
|
||||||
instance.set(name, Snowflake.generate());
|
instance.set(name, Snowflake.generate());
|
||||||
}
|
}
|
||||||
|
@ -985,7 +985,9 @@ describe('export to xlsx', () => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
await User.model.bulkCreate(values);
|
await User.repository.createMany({
|
||||||
|
records: values,
|
||||||
|
});
|
||||||
|
|
||||||
const exporter = new XlsxExporter({
|
const exporter = new XlsxExporter({
|
||||||
collectionManager: app.mainDataSource.collectionManager,
|
collectionManager: app.mainDataSource.collectionManager,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user