Skip to content

Commit

Permalink
fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalojaubert committed Nov 28, 2023
1 parent 1e9d2dc commit 6550737
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { ApolloClient, NormalizedCacheObject, gql } from '@apollo/client'
import { random, commerce, finance, lorem, internet } from 'faker'
import { expect } from 'chai'
import { sleep, waitForIt } from '../../helper/sleep'
import { waitForIt } from '../../helper/sleep'
import { applicationUnderTest } from './setup'
import { UUID } from '@boostercloud/framework-types'
import { NEW_CART_IDS, QUANTITY_AFTER_DATA_MIGRATION_V2, QUANTITY_TO_MIGRATE_DATA } from '../../../src/constants'
import { ProductType } from '../../../src/entities/product'

const secs = 10

describe('Entities end-to-end tests', () => {
let client: ApolloClient<NormalizedCacheObject>
let userToken: string
Expand Down Expand Up @@ -147,9 +145,6 @@ describe('Entities end-to-end tests', () => {
`,
})

console.log(`Waiting ${secs} second${secs > 1 ? 's' : ''} for deletion to complete...`)
await sleep(secs * 1000)

client = applicationUnderTest.graphql.client(userToken)
// Retrieve updated entity
const queryResult = await waitForIt(
Expand Down Expand Up @@ -178,7 +173,7 @@ describe('Entities end-to-end tests', () => {
`,
})
},
() => true
(result) => !result?.data?.ProductReadModel
)

const productData = queryResult.data.ProductReadModel
Expand Down

0 comments on commit 6550737

Please sign in to comment.