Skip to content

Commit c82ee1d

Browse files
Update the code of mockCDNSettingsAPI() to use CDNSettings
1 parent f2b70d4 commit c82ee1d

File tree

1 file changed

+12
-8
lines changed
  • packages/consent/consent-tools-integration-tests/src/page-objects

1 file changed

+12
-8
lines changed

packages/consent/consent-tools-integration-tests/src/page-objects/base-page.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { CDNSettingsBuilder } from '@internal/test-helpers'
12
import { Page, Route, Request } from '@playwright/test'
23

34
export abstract class BasePage {
@@ -84,27 +85,30 @@ export abstract class BasePage {
8485
}
8586

8687
private async mockCDNSettingsAPI() {
87-
const settings = {
88-
integrations: {
89-
FullStory: {
88+
const cdnSettings = new CDNSettingsBuilder()
89+
.addActionDestinationSettings(
90+
{
91+
creationName: 'FullStory',
9092
url: 'https://cdn.segment.com/next-integrations/actions/fullstory-plugins/foo.js',
9193
consentSettings: {
9294
categories: ['FooCategory2'],
9395
},
9496
},
95-
'Actions Amplitude': {
97+
{
98+
creationName: 'Actions Amplitude',
9699
url: 'https://cdn.segment.com/next-integrations/actions/amplitude-plugins/foo.js',
97100
consentSettings: {
98101
categories: ['FooCategory1'],
99102
},
100-
},
101-
},
102-
}
103+
}
104+
)
105+
.build()
103106

104107
await this.page.route('**/settings', async (route: Route) => {
105108
await route.fulfill({
106109
status: 200,
107-
body: JSON.stringify(settings),
110+
contentType: 'application/json',
111+
body: JSON.stringify(cdnSettings),
108112
})
109113
})
110114
}

0 commit comments

Comments
 (0)