Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix unit test

Fendy Heryantoa9f9501c5616
diff --git a/packages/nocodb/tests/unit/rest/tests/dataApiV3/attachment.test.ts b/packages/nocodb/tests/unit/rest/tests/dataApiV3/attachment.test.ts
index 879385ad31..4ad0bb6af1 100644
--- a/packages/nocodb/tests/unit/rest/tests/dataApiV3/attachment.test.ts
+++ b/packages/nocodb/tests/unit/rest/tests/dataApiV3/attachment.test.ts
@@ -48,7 +48,6 @@ describe('Attachment V3', () => {
});
afterEach(function () {
- nock.restore();
nock.cleanAll();
});
@@ -203,6 +202,7 @@ describe('Attachment V3', () => {
],
});
+ let retry = 0;
let getRsp1;
do {
// wait until worker is done
@@ -215,7 +215,8 @@ describe('Attachment V3', () => {
getRsp1 = await ncAxiosGet({
url: `${urlPrefix}/${table.id}/records/${rsp.body.records[0].id}`,
});
- } while (getRsp1.body.fields.Attachment.length === 0);
+ retry++
+ } while (getRsp1.body.fields.Attachment.length === 0 && retry < 50);
const recordId = rsp.body.records[0].id;
const columnId = table.columns.find((col) => col.title === 'Attachment').id;