2022-11-07 20:42:07 +01:00
|
|
|
export const accountTests = async (config, store, chai) => {
|
|
|
|
const expect = chai.expect
|
|
|
|
|
|
|
|
/*
|
|
|
|
consent Int @default(0)
|
|
|
|
data String @default("{}")
|
|
|
|
ehash String @unique
|
|
|
|
email String
|
|
|
|
newsletter Boolean @default(false)
|
|
|
|
password String
|
|
|
|
username String
|
|
|
|
lusername String @unique
|
|
|
|
*/
|
|
|
|
|
|
|
|
describe(`${store.icon('user')} Update account data`, async function () {
|
|
|
|
it(`${store.icon('user')} Should update consent to 3 (jwt)`, (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.api)
|
|
|
|
.put('/account/jwt')
|
|
|
|
.set('Authorization', 'Bearer ' + store.account.token)
|
2022-11-08 21:04:32 +01:00
|
|
|
.send({
|
|
|
|
consent: 3,
|
|
|
|
data: {
|
|
|
|
banana: 'Sure',
|
|
|
|
},
|
|
|
|
newsletter: true,
|
|
|
|
password: 'Something new',
|
|
|
|
username: 'new',
|
|
|
|
})
|
2022-11-07 20:42:07 +01:00
|
|
|
.end((err, res) => {
|
|
|
|
expect(err === null).to.equal(true)
|
|
|
|
expect(res.status).to.equal(200)
|
|
|
|
expect(res.body.result).to.equal(`success`)
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|