Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
silesky committed Nov 2, 2023
1 parent e81171c commit 8fce3aa
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ describe('High level "integration" tests', () => {
it('should load if alert box is closed and groups are defined', async () => {
withOneTrust(analyticsMock)

const shouldLoadP = Promise.resolve(
const shouldLoadSegment = Promise.resolve(
createWrapperSpyHelper.shouldLoadSegment({} as any)
)
OneTrustMockGlobal.GetDomainData.mockReturnValueOnce(domainDataMock)
Expand All @@ -68,19 +68,19 @@ describe('High level "integration" tests', () => {
domainGroupMock.StrictlyNeccessary.CustomGroupId,
])
checkResolveWhen()
await expect(shouldLoadP).resolves.toBeUndefined()
await expect(shouldLoadSegment).resolves.toBeUndefined()
})

it('should not load at all if no groups are defined', async () => {
withOneTrust(analyticsMock)
getConsentedGroupIdsSpy.mockImplementation(() => [])
const shouldLoadP = Promise.resolve(
const shouldLoadSegment = Promise.resolve(
createWrapperSpyHelper.shouldLoadSegment({} as any)
)
void shouldLoadP.catch(() => {})
void shouldLoadSegment.catch(() => {})
OneTrustMockGlobal.IsAlertBoxClosed.mockReturnValueOnce(true)
checkResolveWhen()
await expect(shouldLoadP).rejects.toEqual(expect.anything())
await expect(shouldLoadSegment).rejects.toEqual(expect.anything())
})

it("should load regardless of AlertBox status if showAlertNotice is true (e.g. 'show banner is unchecked')", async () => {
Expand All @@ -92,12 +92,12 @@ describe('High level "integration" tests', () => {
getConsentedGroupIdsSpy.mockImplementation(() => [
domainGroupMock.StrictlyNeccessary.CustomGroupId,
])
const shouldLoadP = Promise.resolve(
const shouldLoadSegment = Promise.resolve(
createWrapperSpyHelper.shouldLoadSegment({} as any)
)
OneTrustMockGlobal.IsAlertBoxClosed.mockReturnValueOnce(false) // alert box is _never open
checkResolveWhen()
await expect(shouldLoadP).resolves.toBeUndefined()
await expect(shouldLoadSegment).resolves.toBeUndefined()
})
})

Expand Down

0 comments on commit 8fce3aa

Please sign in to comment.