Skip to content

Commit af2cfb3

Browse files
committed
style(test): apply prettier to the nav permission source spec
1 parent faac672 commit af2cfb3

1 file changed

Lines changed: 37 additions & 16 deletions

File tree

tests/e2e/workflows/nav-permission-source.spec.ts

Lines changed: 37 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,23 +113,34 @@ async function isAdminStateOf(page: Page, account: string): Promise<unknown> {
113113
`${account}: the dashboard must publish initial state decidiq/isAdmin`,
114114
).toHaveCount(1, { timeout: 30_000 })
115115
const raw = await input.getAttribute('value')
116-
expect(raw, `${account}: initial state decidiq/isAdmin has no value`).not.toBeNull()
116+
expect(
117+
raw,
118+
`${account}: initial state decidiq/isAdmin has no value`,
119+
).not.toBeNull()
117120
return JSON.parse(Buffer.from(raw as string, 'base64').toString('utf8'))
118121
}
119122

120123
test.describe('decidiq#1267: the server tells the SPA whether the account is an administrator', () => {
121124
test.beforeAll(async ({ playwright }) => {
122125
const admin = await playwright.request.newContext({
123-
httpCredentials: { password: ADMIN_PASS, send: 'always', username: ADMIN_USER },
126+
httpCredentials: {
127+
password: ADMIN_PASS,
128+
send: 'always',
129+
username: ADMIN_USER,
130+
},
124131
storageState: { cookies: [], origins: [] },
125132
})
126-
const created = await admin.post(`${BASE}/ocs/v2.php/cloud/users?format=json`, {
127-
data: { password: MEMBER.password, userid: MEMBER.uid },
128-
headers: OCS,
129-
})
130-
expect(created.ok(), `creating account ${MEMBER.uid}: ${await summarise(created)}`).toBe(
131-
true,
133+
const created = await admin.post(
134+
`${BASE}/ocs/v2.php/cloud/users?format=json`,
135+
{
136+
data: { password: MEMBER.password, userid: MEMBER.uid },
137+
headers: OCS,
138+
},
132139
)
140+
expect(
141+
created.ok(),
142+
`creating account ${MEMBER.uid}: ${await summarise(created)}`,
143+
).toBe(true)
133144

134145
// The whole point of this account is that it holds nothing. Prove it
135146
// before relying on it, so a stray default group cannot make the
@@ -138,9 +149,10 @@ test.describe('decidiq#1267: the server tells the SPA whether the account is an
138149
`${BASE}/ocs/v2.php/cloud/users/${MEMBER.uid}/groups?format=json`,
139150
{ headers: OCS },
140151
)
141-
expect(groups.ok(), `reading the groups of ${MEMBER.uid}: ${await summarise(groups)}`).toBe(
142-
true,
143-
)
152+
expect(
153+
groups.ok(),
154+
`reading the groups of ${MEMBER.uid}: ${await summarise(groups)}`,
155+
).toBe(true)
144156
const body = await groups.json()
145157
expect(
146158
body?.ocs?.data?.groups ?? [],
@@ -151,12 +163,19 @@ test.describe('decidiq#1267: the server tells the SPA whether the account is an
151163

152164
test.afterAll(async ({ playwright }) => {
153165
const admin = await playwright.request.newContext({
154-
httpCredentials: { password: ADMIN_PASS, send: 'always', username: ADMIN_USER },
166+
httpCredentials: {
167+
password: ADMIN_PASS,
168+
send: 'always',
169+
username: ADMIN_USER,
170+
},
155171
storageState: { cookies: [], origins: [] },
156172
})
157-
await admin.delete(`${BASE}/ocs/v2.php/cloud/users/${MEMBER.uid}?format=json`, {
158-
headers: OCS,
159-
})
173+
await admin.delete(
174+
`${BASE}/ocs/v2.php/cloud/users/${MEMBER.uid}?format=json`,
175+
{
176+
headers: OCS,
177+
},
178+
)
160179
await admin.dispose()
161180
})
162181

@@ -172,7 +191,9 @@ test.describe('decidiq#1267: the server tells the SPA whether the account is an
172191
}
173192
})
174193

175-
test('an account in no group receives isAdmin false, not nothing', async ({ browser }) => {
194+
test('an account in no group receives isAdmin false, not nothing', async ({
195+
browser,
196+
}) => {
176197
const page = await openDashboardAs(browser, MEMBER.uid, MEMBER.password)
177198
try {
178199
// toBe(false), not toBeFalsy(): an absent value is exactly the

0 commit comments

Comments
 (0)