aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/test/entities/copper_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/pipeline/test/entities/copper_test.ts')
-rw-r--r--packages/pipeline/test/entities/copper_test.ts54
1 files changed, 54 insertions, 0 deletions
diff --git a/packages/pipeline/test/entities/copper_test.ts b/packages/pipeline/test/entities/copper_test.ts
new file mode 100644
index 000000000..2543364e6
--- /dev/null
+++ b/packages/pipeline/test/entities/copper_test.ts
@@ -0,0 +1,54 @@
+import 'mocha';
+import 'reflect-metadata';
+
+import {
+ CopperActivity,
+ CopperActivityType,
+ CopperCustomField,
+ CopperLead,
+ CopperOpportunity,
+} from '../../src/entities';
+import { createDbConnectionOnceAsync } from '../db_setup';
+import {
+ ParsedActivities,
+ ParsedActivityTypes,
+ ParsedCustomFields,
+ ParsedLeads,
+ ParsedOpportunities,
+} from '../fixtures/copper/parsed_entities';
+import { chaiSetup } from '../utils/chai_setup';
+
+import { testSaveAndFindEntityAsync } from './util';
+
+chaiSetup.configure();
+
+describe('Copper entities', () => {
+ describe('save and find', async () => {
+ it('Copper lead', async () => {
+ const connection = await createDbConnectionOnceAsync();
+ const repository = connection.getRepository(CopperLead);
+ ParsedLeads.forEach(async entity => testSaveAndFindEntityAsync(repository, entity));
+ });
+ it('Copper activity', async () => {
+ const connection = await createDbConnectionOnceAsync();
+ const repository = connection.getRepository(CopperActivity);
+ ParsedActivities.forEach(async entity => testSaveAndFindEntityAsync(repository, entity));
+ });
+ // searching on jsonb fields is broken in typeorm
+ it.skip('Copper opportunity', async () => {
+ const connection = await createDbConnectionOnceAsync();
+ const repository = connection.getRepository(CopperOpportunity);
+ ParsedOpportunities.forEach(async entity => testSaveAndFindEntityAsync(repository, entity));
+ });
+ it('Copper activity type', async () => {
+ const connection = await createDbConnectionOnceAsync();
+ const repository = connection.getRepository(CopperActivityType);
+ ParsedActivityTypes.forEach(async entity => testSaveAndFindEntityAsync(repository, entity));
+ });
+ it('Copper custom field', async () => {
+ const connection = await createDbConnectionOnceAsync();
+ const repository = connection.getRepository(CopperCustomField);
+ ParsedCustomFields.forEach(async entity => testSaveAndFindEntityAsync(repository, entity));
+ });
+ });
+});