Skip to content

Commit cd55d2d

Browse files
authored
Merge pull request #2089 from ConductionNL/chore/prettier-format
chore(format): prettier was never run over eighteen frontend files
2 parents 3646591 + e32e4f2 commit cd55d2d

18 files changed

Lines changed: 331 additions & 136 deletions

‎src/modals/v2/SourceFormFields.vue‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,10 @@
280280
}}
281281
</span>
282282
<div
283-
v-if="!digitalPostLoading && digitalPostProviderOptions.length === 0"
283+
v-if="
284+
!digitalPostLoading
285+
&& digitalPostProviderOptions.length === 0
286+
"
284287
class="cn-source-form-fields__note">
285288
{{
286289
t(
@@ -450,7 +453,9 @@ export default {
450453
const id = String(this.formData?.configuration?.provider ?? '')
451454
if (!id) return null
452455
return (
453-
this.digitalPostProviderOptions.find((option) => option.id === id) ?? {
456+
this.digitalPostProviderOptions.find(
457+
(option) => option.id === id,
458+
) ?? {
454459
id,
455460
label: id,
456461
}
@@ -484,7 +489,11 @@ export default {
484489
// The type can be switched after the form opened. Without this the
485490
// picker would render with an empty list and read as "no binding
486491
// installed" on an instance that has three.
487-
if (this.showsDigitalPostPicker && this.digitalPostProviders.length === 0 && !this.digitalPostLoading) {
492+
if (
493+
this.showsDigitalPostPicker
494+
&& this.digitalPostProviders.length === 0
495+
&& !this.digitalPostLoading
496+
) {
488497
this.fetchDigitalPostProviders()
489498
}
490499
},

‎tests/e2e/digital-post-source.spec.ts‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ test.describe('digital post source', () => {
6262
{ providerId: 'berichtenbox', senderOin: '00000001234567890000' },
6363
`E2E berichtenbox no cert ${stamp}`,
6464
)
65-
const id = String(source.id ?? (source['@self'] as Record<string, string>)?.id)
65+
const id = String(
66+
source.id ?? (source['@self'] as Record<string, string>)?.id,
67+
)
6668

6769
// Activation is enabling the source. The refusal has to reach the
6870
// operator rather than surfacing at the first letter.
@@ -90,10 +92,9 @@ test.describe('digital post source', () => {
9092
test('a flagged instance with no credentials refuses rather than simulating', async ({
9193
request,
9294
}) => {
93-
const resp = await request.get(
94-
'/index.php/apps/integriq/api/health',
95-
{ failOnStatusCode: false },
96-
)
95+
const resp = await request.get('/index.php/apps/integriq/api/health', {
96+
failOnStatusCode: false,
97+
})
9798
expect(resp.status()).toBe(200)
9899

99100
// The flag is off on a stock instance, so what this asserts is the
@@ -123,7 +124,10 @@ test.describe('digital post source', () => {
123124
.toLowerCase()
124125
.includes('berichtenbox'),
125126
)
126-
test.skip(entry === undefined, 'no Berichtenbox catalog entry on this instance')
127+
test.skip(
128+
entry === undefined,
129+
'no Berichtenbox catalog entry on this instance',
130+
)
127131

128132
const text = JSON.stringify(entry).toLowerCase()
129133
// The product, and both credentials it cannot work without.

‎tests/e2e/intake-channels.spec.ts‎

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ const SECRET = 'e2e-intake-secret'
3232
*/
3333
function sign(body: string): string {
3434
const timestamp = Math.floor(Date.now() / 1000)
35-
const signature = createHmac('sha256', SECRET).update(`${timestamp}.${body}`).digest('hex')
35+
const signature = createHmac('sha256', SECRET)
36+
.update(`${timestamp}.${body}`)
37+
.digest('hex')
3638

3739
return `t=${timestamp},v1=${signature}`
3840
}
@@ -43,7 +45,10 @@ function sign(body: string): string {
4345
* @param request The Playwright request context.
4446
* @param channelId The channel id.
4547
*/
46-
async function seedChannelSource(request: APIRequestContext, channelId: string): Promise<void> {
48+
async function seedChannelSource(
49+
request: APIRequestContext,
50+
channelId: string,
51+
): Promise<void> {
4752
const resp = await request.post(`${OR_BASE}/source`, {
4853
failOnStatusCode: false,
4954
data: {
@@ -67,7 +72,10 @@ async function seedChannelSource(request: APIRequestContext, channelId: string):
6772
* @param request The Playwright request context.
6873
* @param rule The rule.
6974
*/
70-
async function seedRule(request: APIRequestContext, rule: Record<string, unknown>): Promise<void> {
75+
async function seedRule(
76+
request: APIRequestContext,
77+
rule: Record<string, unknown>,
78+
): Promise<void> {
7179
const resp = await request.post(`${OR_BASE}/intake_routing_rule`, {
7280
failOnStatusCode: false,
7381
data: rule,
@@ -89,14 +97,17 @@ async function deliver(
8997
payload: Record<string, unknown>,
9098
): Promise<Record<string, any>> {
9199
const body = JSON.stringify(payload)
92-
const resp = await request.post(`${API_BASE}/intake/channels/${channelId}/inbound`, {
93-
failOnStatusCode: false,
94-
headers: {
95-
'Content-Type': 'application/json',
96-
'X-OpenConnector-Signature': sign(body),
100+
const resp = await request.post(
101+
`${API_BASE}/intake/channels/${channelId}/inbound`,
102+
{
103+
failOnStatusCode: false,
104+
headers: {
105+
'Content-Type': 'application/json',
106+
'X-OpenConnector-Signature': sign(body),
107+
},
108+
data: body,
97109
},
98-
data: body,
99-
})
110+
)
100111
expect(resp.status(), 'a signed delivery must be accepted').toBe(202)
101112

102113
return await resp.json()
@@ -164,14 +175,18 @@ test.describe('intake channels', () => {
164175
expect(result.status).toBe('held')
165176
expect(result.reason).toContain('messaging')
166177

167-
await page.goto(`${APP_BASE}/messages/intake`, { waitUntil: 'domcontentloaded' })
178+
await page.goto(`${APP_BASE}/messages/intake`, {
179+
waitUntil: 'domcontentloaded',
180+
})
168181
await expect(
169182
page.getByText('Een vraag zonder regel').first(),
170183
'a held message is on the page somebody actually reads',
171184
).toBeVisible({ timeout: 20_000 })
172185
})
173186

174-
test('a mapping onto a field that does not exist fails at configuration time', async ({ request }) => {
187+
test('a mapping onto a field that does not exist fails at configuration time', async ({
188+
request,
189+
}) => {
175190
const resp = await request.post(`${API_BASE}/intake/routing-rules`, {
176191
failOnStatusCode: false,
177192
headers: { 'OCS-APIRequest': 'true' },
@@ -186,7 +201,9 @@ test.describe('intake channels', () => {
186201

187202
expect(resp.status(), 'the save must be refused').toBe(400)
188203
const body = await resp.json()
189-
expect(body.error, 'and it must name the field').toContain('veldDatNietBestaat')
204+
expect(body.error, 'and it must name the field').toContain(
205+
'veldDatNietBestaat',
206+
)
190207
})
191208

192209
test('an anonymous caller cannot change routing', async () => {
@@ -200,7 +217,11 @@ test.describe('intake channels', () => {
200217
const resp = await anonymous.post(`${API_BASE}/intake/routing-rules`, {
201218
failOnStatusCode: false,
202219
headers: { 'OCS-APIRequest': 'true' },
203-
data: { name: 'nope', channelId: 'messaging', targetSchema: 'algemene_vraag' },
220+
data: {
221+
name: 'nope',
222+
channelId: 'messaging',
223+
targetSchema: 'algemene_vraag',
224+
},
204225
})
205226

206227
expect(resp.status()).toBeGreaterThanOrEqual(401)

‎tests/e2e/mail-intake.spec.ts‎

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ async function seedMailbox(request: APIRequestContext): Promise<string> {
5353
}
5454

5555
test.describe('mail intake', () => {
56-
test('an operator imports a saved Outlook message', async ({ page, request }) => {
56+
test('an operator imports a saved Outlook message', async ({
57+
page,
58+
request,
59+
}) => {
5760
const sourceId = await seedMailbox(request)
5861
const file = readFileSync(join(__dirname, 'fixtures', 'outlook-message.msg'))
5962

@@ -86,28 +89,33 @@ test.describe('mail intake', () => {
8689
).toBe('ZAAK-2026-0042')
8790

8891
// The message is on the page an operator actually looks at.
89-
await page.goto(`${APP_BASE}/messages/mail`, { waitUntil: 'domcontentloaded' })
92+
await page.goto(`${APP_BASE}/messages/mail`, {
93+
waitUntil: 'domcontentloaded',
94+
})
9095
await expect(
9196
page.getByText('Vraag over ZAAK-2026-0042').first(),
9297
).toBeVisible({ timeout: 20_000 })
9398
})
9499

95-
test('a second import of the same message creates nothing new', async ({ request }) => {
100+
test('a second import of the same message creates nothing new', async ({
101+
request,
102+
}) => {
96103
const sourceId = await seedMailbox(request)
97104
const file = readFileSync(join(__dirname, 'fixtures', 'outlook-message.msg'))
98105

99-
const importOnce = async () => await request.post(`${API_BASE}/mail-intake/import`, {
100-
failOnStatusCode: false,
101-
headers: { 'OCS-APIRequest': 'true' },
102-
multipart: {
103-
sourceId,
104-
file: {
105-
name: 'outlook-message.msg',
106-
mimeType: 'application/vnd.ms-outlook',
107-
buffer: file,
106+
const importOnce = async () =>
107+
await request.post(`${API_BASE}/mail-intake/import`, {
108+
failOnStatusCode: false,
109+
headers: { 'OCS-APIRequest': 'true' },
110+
multipart: {
111+
sourceId,
112+
file: {
113+
name: 'outlook-message.msg',
114+
mimeType: 'application/vnd.ms-outlook',
115+
buffer: file,
116+
},
108117
},
109-
},
110-
})
118+
})
111119

112120
const first = await importOnce()
113121
const second = await importOnce()

‎tests/e2e/migration-file-source.spec.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import { expect, test } from '@playwright/test'
1818

1919
const API_BASE = '/index.php/apps/integriq/api/migration-sources'
2020

21-
const DELIVERY = 'zaaknummer,naam,plaats\nZ-1,De Vries,Utrecht\nZ-2,Jansen,Amsterdam\n'
21+
const DELIVERY =
22+
'zaaknummer,naam,plaats\nZ-1,De Vries,Utrecht\nZ-2,Jansen,Amsterdam\n'
2223
const SECOND_DELIVERY = 'zaaknummer,naam,plaats\nZ-3,Bakker,Veenendaal\n'
2324

2425
/** The mapping an administrator authors once and stores. */
@@ -86,9 +87,7 @@ test.describe('migration sources', () => {
8687
const secondBody = await second.json()
8788
expect(secondBody.kinds[0].count).toBe(1)
8889
expect(secondBody.kinds[0].sample[0].data.requesterName).toBe('Bakker')
89-
expect(secondBody.kinds[0].sample[0].provenance.sourceIdentifier).toBe(
90-
'Z-3',
91-
)
90+
expect(secondBody.kinds[0].sample[0].provenance.sourceIdentifier).toBe('Z-3')
9291
})
9392

9493
// @e2e migration-sources::a-mapping-onto-a-field-that-does-not-exist-is-refused-at-save

‎tests/e2e/outbound-call-log.spec.ts‎

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,24 @@ async function seedCall(
6969
}
7070

7171
test.describe('outbound call log', () => {
72-
test('a failed call is found without a container log', async ({ page, request }) => {
72+
test('a failed call is found without a container log', async ({
73+
page,
74+
request,
75+
}) => {
7376
await seedCall(request, { statusMessage: 'E2E StUF fout op de partner' })
7477

75-
await page.goto(`${APP_BASE}/sources/logs`, { waitUntil: 'domcontentloaded' })
78+
await page.goto(`${APP_BASE}/sources/logs`, {
79+
waitUntil: 'domcontentloaded',
80+
})
7681
await expect(
7782
page.getByText('E2E StUF fout op de partner').first(),
7883
'the failure is on the screen, with the fault the partner returned',
7984
).toBeVisible({ timeout: 20_000 })
8085
})
8186

82-
test('a replay shows what it would send before it sends it', async ({ request }) => {
87+
test('a replay shows what it would send before it sends it', async ({
88+
request,
89+
}) => {
8390
const id = await seedCall(request)
8491

8592
const preview = await request.get(`${API_BASE}/calls/${id}/preview`, {
@@ -116,7 +123,9 @@ test.describe('outbound call log', () => {
116123
).toBe(1)
117124
})
118125

119-
test('a replay appends an attempt and leaves the first readable', async ({ request }) => {
126+
test('a replay appends an attempt and leaves the first readable', async ({
127+
request,
128+
}) => {
120129
const id = await seedCall(request)
121130

122131
const resp = await request.post(`${API_BASE}/calls/${id}/replay`, {
@@ -127,14 +136,19 @@ test.describe('outbound call log', () => {
127136
expect(resp.status(), 'the replay must answer, not error').toBeLessThan(500)
128137

129138
const after = await (await request.get(`${OR_BASE}/call_log/${id}`)).json()
130-
expect(after.attempts.length, 'the replay is an attempt on the same record').toBeGreaterThan(1)
139+
expect(
140+
after.attempts.length,
141+
'the replay is an attempt on the same record',
142+
).toBeGreaterThan(1)
131143
expect(
132144
after.attempts[0].outcome,
133145
'and the attempt that failed first is still there, because it is why somebody looked',
134146
).toBe('failed')
135147
})
136148

137-
test('a replay can be asked to run under the current mapping version', async ({ request }) => {
149+
test('a replay can be asked to run under the current mapping version', async ({
150+
request,
151+
}) => {
138152
const id = await seedCall(request)
139153

140154
const resp = await request.post(`${API_BASE}/calls/${id}/replay`, {
@@ -157,18 +171,28 @@ test.describe('outbound call log', () => {
157171
headers: { 'OCS-APIRequest': 'true' },
158172
data: {
159173
target: 'e2e-notificaties-partner',
160-
request: { method: 'POST', endpoint: '/notificaties', body: { kanaal: 'zaken' } },
174+
request: {
175+
method: 'POST',
176+
endpoint: '/notificaties',
177+
body: { kanaal: 'zaken' },
178+
},
161179
dryRun: true,
162180
},
163181
})
164182

165183
expect(resp.status()).toBe(201)
166184
const body = await resp.json()
167-
expect(body.sent, 'a dry run of a hand-fired call sends nothing either').toBe(false)
185+
expect(
186+
body.sent,
187+
'a dry run of a hand-fired call sends nothing either',
188+
).toBe(false)
168189
expect(body.request.endpoint).toBe('/notificaties')
169190
})
170191

171-
test('an external verdict is visible, and changes nothing', async ({ page, request }) => {
192+
test('an external verdict is visible, and changes nothing', async ({
193+
page,
194+
request,
195+
}) => {
172196
const seed = await request.post(`${OR_BASE}/verdict`, {
173197
failOnStatusCode: false,
174198
data: {
@@ -182,6 +206,8 @@ test.describe('outbound call log', () => {
182206
expect(seed.status(), 'seeding a verdict must succeed').toBeLessThan(300)
183207

184208
await page.goto(`${APP_BASE}/verdicts`, { waitUntil: 'domcontentloaded' })
185-
await expect(page.getByText('E2E ontbrekende bijlage').first()).toBeVisible({ timeout: 20_000 })
209+
await expect(page.getByText('E2E ontbrekende bijlage').first()).toBeVisible({
210+
timeout: 20_000,
211+
})
186212
})
187213
})

0 commit comments

Comments
 (0)