Changeset View
Changeset View
Standalone View
Standalone View
lib/app/base-chips/collections/registration-intents.subtest.js
const locreq = require("locreq")(__dirname); | const locreq = require("locreq")(__dirname); | ||||
const axios = require("axios"); | const axios = require("axios"); | ||||
const assert = require("assert"); | const assert = require("assert"); | ||||
const { assert_throws_async } = locreq("test_utils"); | const { assert_throws_async } = locreq("test_utils"); | ||||
const { with_running_app, with_stopped_app } = locreq( | const { with_running_app, with_stopped_app } = locreq( | ||||
"test_utils/with-test-app.js" | "test_utils/with-test-app.js" | ||||
); | ); | ||||
describe("registration-intents", () => { | describe("registration-intents", () => { | ||||
async function create_a_user(app) { | |||||
await app.run_action( | |||||
new app.Sealious.SuperContext(), | |||||
["collections", "users"], | |||||
"create", | |||||
{ | |||||
username: "user", | |||||
email: "user@example.com", | |||||
password: "password", | |||||
} | |||||
); | |||||
} | |||||
it("doesn't allow setting a role for registration intention when the user in context can't create user-roles", async () => | it("doesn't allow setting a role for registration intention when the user in context can't create user-roles", async () => | ||||
with_running_app(async ({ app, base_url }) => { | with_running_app(async ({ app, base_url }) => { | ||||
app.ChipManager.get_chip( | app.ChipManager.get_chip( | ||||
"collection", | "collection", | ||||
"user-roles" | "user-roles" | ||||
).set_access_strategy({ | ).set_access_strategy({ | ||||
create: "noone", | create: "noone", | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |