Changeset View
Changeset View
Standalone View
Standalone View
lib/app/base-chips/field-types/text.subtest.js
Show All 20 Lines | describe("text", () => { | ||||
function assert_creation_error_factory({ base_url, collection }) { | function assert_creation_error_factory({ base_url, collection }) { | ||||
return async ({ resource, message }) => { | return async ({ resource, message }) => { | ||||
try { | try { | ||||
await axios.post( | await axios.post( | ||||
`${base_url}/api/v1/collections/${collection}`, | `${base_url}/api/v1/collections/${collection}`, | ||||
resource | resource | ||||
); | ); | ||||
throw "This should not pass"; | throw new Error("This should not pass"); | ||||
} catch (e) { | } catch (e) { | ||||
assert.deepEqual(e.response.data.data.surname.message, message); | assert.deepEqual(e.response.data.data.surname.message, message); | ||||
} | } | ||||
}; | }; | ||||
} | } | ||||
it("shouldn't allow a value that isn't a string", async () => | it("shouldn't allow a value that isn't a string", async () => | ||||
with_running_app(async ({ app, base_url }) => { | with_running_app(async ({ app, base_url }) => { | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |