diff --git a/infrastructure/cdk/test/analytics.test.ts b/infrastructure/cdk/test/analytics.test.ts index 8ed945dbe..5ac8025b6 100644 --- a/infrastructure/cdk/test/analytics.test.ts +++ b/infrastructure/cdk/test/analytics.test.ts @@ -2,7 +2,7 @@ import * as cdk from 'aws-cdk-lib' import * as assertions from 'aws-cdk-lib/assertions' import { Config } from '../src/providers/config' import { AnalyticsStack } from '../src/providers/analytics' -import { Schema, eventSchema, walletSchema, stakingActionSchema } from '@casimir/data' +import { Schema, eventSchema, actionSchema } from '@casimir/data' test('Analytics stack created', () => { const config = new Config() @@ -27,28 +27,15 @@ test('Analytics stack created', () => { expect(columnName).toEqual(name) } - const walletTable = Object.keys(resource).filter(key => key.includes('WalletTable'))[0] - const walletColumns = resource[walletTable].Properties.TableInput.StorageDescriptor.Columns - const walletGlueSchema = new Schema(walletSchema).getGlueColumns() + const actionTable = Object.keys(resource).filter(key => key.includes('WalletTable'))[0] + const actionColumns = resource[actionTable].Properties.TableInput.StorageDescriptor.Columns + const actionGlueSchema = new Schema(actionSchema).getGlueColumns() - for (const column of walletColumns) { + for (const column of actionColumns) { const { Name: name, Type: type } = column - const columnName = Object.keys(walletSchema.properties).filter(key => key === name)[0] - const columnType = walletGlueSchema.filter(key => key.name === name)[0].type.inputString - - expect(columnType).toEqual(type) - expect(columnName).toEqual(name) - } - - const stakingActionTable = Object.keys(resource).filter(key => key.includes('StakingActionTable'))[0] - const stakingActionColumns = resource[stakingActionTable].Properties.TableInput.StorageDescriptor.Columns - const stakingActionGlueSchema = new Schema(stakingActionSchema).getGlueColumns() - - for (const column of stakingActionColumns) { - const { Name: name, Type: type } = column - const columnName = Object.keys(stakingActionSchema.properties).filter(key => key === name)[0] - const columnType = stakingActionGlueSchema.filter(key => key.name === name)[0].type.inputString + const columnName = Object.keys(actionSchema.properties).filter(key => key === name)[0] + const columnType = actionGlueSchema.filter(key => key.name === name)[0].type.inputString expect(columnType).toEqual(type) expect(columnName).toEqual(name)