Skip to content

Commit 5639c2a

Browse files
committed
PD-5079
1 parent 7fb492a commit 5639c2a

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

‎src/app/core/record-works/record-works.service.spec.ts‎

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,18 @@ describe('RecordWorksService', () => {
150150
done()
151151
})
152152

153-
const req = httpTestingController.expectOne(
153+
const wizardReq = httpTestingController.expectOne(
154154
runtimeEnvironment.API_WEB +
155155
'workspace/retrieve-works-search-and-link-wizard.json'
156156
)
157-
expect(req.request.method).toBe('GET')
158-
req.flush(listPayload)
157+
expect(wizardReq.request.method).toBe('GET')
158+
wizardReq.flush(listPayload)
159+
160+
// Service also requests localize .properties when CERTIFIED_LINKS_LOCALIZE_BASE_URL is set
161+
const localizeReqs = httpTestingController.match((req) =>
162+
req.url.includes('works-search-and-link') && req.url.endsWith('.properties')
163+
)
164+
localizeReqs.forEach((r) => r.flush(''))
159165
})
160166

161167
it('returns empty certified and more lists when API returns empty array', (done) => {
@@ -166,11 +172,16 @@ describe('RecordWorksService', () => {
166172
done()
167173
})
168174

169-
const req = httpTestingController.expectOne(
175+
const wizardReq = httpTestingController.expectOne(
170176
runtimeEnvironment.API_WEB +
171177
'workspace/retrieve-works-search-and-link-wizard.json'
172178
)
173-
req.flush([])
179+
wizardReq.flush([])
180+
181+
const localizeReqs = httpTestingController.match((req) =>
182+
req.url.includes('works-search-and-link') && req.url.endsWith('.properties')
183+
)
184+
localizeReqs.forEach((r) => r.flush(''))
174185
})
175186
})
176187
})

0 commit comments

Comments
 (0)