Skip to content

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

fix column test

Fendy Heryanto8ea5b365a625
diff --git a/packages/nocodb/tests/unit/rest/tests/metaApiV3/error-handling/column.test.ts b/packages/nocodb/tests/unit/rest/tests/metaApiV3/error-handling/column.test.ts
index 6f17d88409..4bc96c6cad 100644
--- a/packages/nocodb/tests/unit/rest/tests/metaApiV3/error-handling/column.test.ts
+++ b/packages/nocodb/tests/unit/rest/tests/metaApiV3/error-handling/column.test.ts
@@ -49,8 +49,8 @@ export default function () {
.post(`${API_PREFIX}/tables/${table.id}/fields/`)
.set('xc-token', context.xc_token)
.send({ title: 'MyColumn', type: 'SingleLineText' })
- .expect(400);
- expect(result.body.error).to.eq('INVALID_REQUEST_BODY');
+ .expect(422);
+ expect(result.body.error).to.eq('DUPLICATE_ALIAS');
expect(result.body.message).to.include('Duplicate column alias');
});
it('will handle incorrect title length', async () => {
@@ -127,8 +127,8 @@ export default function () {
.patch(`${API_PREFIX}/fields/${column.id}`)
.set('xc-token', context.xc_token)
.send({ title: 'AnotherColumn' })
- .expect(400);
- expect(result.body.error).to.eq('INVALID_REQUEST_BODY');
+ .expect(422);
+ expect(result.body.error).to.eq('DUPLICATE_ALIAS');
expect(result.body.message).to.satisfy((msg) =>
msg.startsWith('Duplicate column alias'),
);