Changeset View
Changeset View
Standalone View
Standalone View
lib/app/base-chips/field-types/settable-by.subtest.js
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | with_running_app(async ({ app, base_url, rest_api }) => { | ||||
create_collections(app); | create_collections(app); | ||||
const response = (await axios.post( | const response = (await axios.post( | ||||
`${base_url}/api/v1/collections/allowed-collection`, | `${base_url}/api/v1/collections/allowed-collection`, | ||||
{ | { | ||||
any: 1, | any: 1, | ||||
} | } | ||||
)).data; | )).data; | ||||
assert.equal(response.body.any, 1); | assert.equal(response.any, 1); | ||||
const response2 = await rest_api.get( | const response2 = await rest_api.get( | ||||
`/api/v1/collections/allowed-collection/${response.id}` | `/api/v1/collections/allowed-collection/${response.id}` | ||||
); | ); | ||||
assert.equal(response2.body.any, 1); | assert.equal(response2.any, 1); | ||||
})); | })); | ||||
it("should not allow invalid value when access strategy allows", async () => | it("should not allow invalid value when access strategy allows", async () => | ||||
with_running_app(async ({ app, base_url }) => { | with_running_app(async ({ app, base_url }) => { | ||||
create_collections(app); | create_collections(app); | ||||
await assert_throws_async( | await assert_throws_async( | ||||
() => | () => | ||||
axios.post( | axios.post( | ||||
Show All 14 Lines |