diff --git a/packages/plugins/collection-manager/src/__tests__/inherits/inherited-collection.test.ts b/packages/plugins/collection-manager/src/__tests__/inherits/inherited-collection.test.ts index 9f624564f..18a248110 100644 --- a/packages/plugins/collection-manager/src/__tests__/inherits/inherited-collection.test.ts +++ b/packages/plugins/collection-manager/src/__tests__/inherits/inherited-collection.test.ts @@ -3,56 +3,6 @@ import Application from '@nocobase/server'; import { createApp } from '..'; import { pgOnly } from '@nocobase/test'; -pgOnly()('Inherited Collection', () => { - let db: Database; - let app: Application; - - let collectionRepository: Repository; - - let fieldsRepository: Repository; - - beforeEach(async () => { - app = await createApp({ - database: { - schema: 'testSchema', - }, - }); - - db = app.db; - - collectionRepository = db.getCollection('collections').repository; - fieldsRepository = db.getCollection('fields').repository; - }); - - afterEach(async () => { - await app.destroy(); - }); - - it('should create inherited collection in difference schema', async () => { - await collectionRepository.create({ - values: { - name: 'b', - fields: [ - { - name: 'name', - type: 'string', - }, - ], - }, - context: {}, - }); - - await collectionRepository.create({ - values: { - name: 'a', - inherits: ['b'], - fields: [{ type: 'string', name: 'bField' }], - }, - context: {}, - }); - }); -}); - pgOnly()('Inherited Collection', () => { let db: Database; let app: Application; diff --git a/packages/plugins/collection-manager/src/__tests__/inherits/inhertied-collection-with-schema.test.ts b/packages/plugins/collection-manager/src/__tests__/inherits/inhertied-collection-with-schema.test.ts new file mode 100644 index 000000000..1b5406fde --- /dev/null +++ b/packages/plugins/collection-manager/src/__tests__/inherits/inhertied-collection-with-schema.test.ts @@ -0,0 +1,54 @@ +import Database, { Repository } from '@nocobase/database'; +import Application from '@nocobase/server'; +import { createApp } from '..'; +import { pgOnly } from '@nocobase/test'; + +pgOnly()('Inherited Collection with schema options', () => { + let db: Database; + let app: Application; + + let collectionRepository: Repository; + + let fieldsRepository: Repository; + + beforeEach(async () => { + app = await createApp({ + database: { + schema: 'testSchema', + }, + }); + + db = app.db; + + collectionRepository = db.getCollection('collections').repository; + fieldsRepository = db.getCollection('fields').repository; + }); + + afterEach(async () => { + await app.destroy(); + }); + + it('should create inherited collection in difference schema', async () => { + await collectionRepository.create({ + values: { + name: 'b', + fields: [ + { + name: 'name', + type: 'string', + }, + ], + }, + context: {}, + }); + + await collectionRepository.create({ + values: { + name: 'a', + inherits: ['b'], + fields: [{ type: 'string', name: 'bField' }], + }, + context: {}, + }); + }); +});