Skip to content

Commit b402933

Browse files
committed
chore: correct tests
1 parent 2a7fc47 commit b402933

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

test/it/it-tests.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ export default (ctx) => describe('Integration Tests: it tests', function () {
334334
limit: newConfigData.length,
335335
offset: 0,
336336
data: newConfigData,
337+
':type': 'sheet',
338+
':sheetname': 'permissions',
337339
}));
338340
resp = await fetch(url, {
339341
method: 'POST',
@@ -354,6 +356,17 @@ export default (ctx) => describe('Integration Tests: it tests', function () {
354356
assert.strictEqual(resp.status, 200, `Expected 200 OK, got ${resp.status}`);
355357
});
356358

359+
it('[limited user] still cannot read page1', async () => {
360+
const {
361+
serverUrl, org, repo, limitedUser,
362+
} = ctx;
363+
const url = `${serverUrl}/source/${org}/${repo}/test-folder/page1.html`;
364+
const resp = await fetch(url, {
365+
headers: { Authorization: `Bearer ${limitedUser.accessToken}` },
366+
});
367+
assert.strictEqual(resp.status, 403, `Expected 403 Unauthorized, got ${resp.status} - user: ${limitedUser.email}`);
368+
});
369+
357370
it('[super user] should remove added entries to clean up the config', async () => {
358371
const {
359372
serverUrl, org, repo, superUser,
@@ -370,6 +383,8 @@ export default (ctx) => describe('Integration Tests: it tests', function () {
370383
limit: newConfigData.length,
371384
offset: 0,
372385
data: newConfigData,
386+
':type': 'sheet',
387+
':sheetname': 'permissions',
373388
}));
374389
resp = await fetch(url, {
375390
method: 'POST',
@@ -391,7 +406,7 @@ export default (ctx) => describe('Integration Tests: it tests', function () {
391406
});
392407

393408
// TODO: currently the auth session is stored in memory, so the limited user can still read page2
394-
it.skip('[limited user] cannot read page2 anymore', async () => {
409+
it('[limited user] cannot read page2 anymore', async () => {
395410
const {
396411
serverUrl, org, repo, limitedUser,
397412
} = ctx;

0 commit comments

Comments
 (0)