2022-10-29 22:21:24 +02:00
|
|
|
import chai from 'chai'
|
|
|
|
import http from 'chai-http'
|
|
|
|
import { verifyConfig } from '../src/config.mjs'
|
2022-10-31 17:54:49 +01:00
|
|
|
import { randomString } from '../src/utils/crypto.mjs'
|
2022-10-29 22:21:24 +02:00
|
|
|
|
|
|
|
const config = verifyConfig()
|
|
|
|
const expect = chai.expect
|
|
|
|
chai.use(http)
|
2022-11-02 12:33:32 +01:00
|
|
|
const user = '🧑'
|
2022-10-29 22:21:24 +02:00
|
|
|
|
2022-11-01 18:00:25 +01:00
|
|
|
const store = {}
|
2022-11-02 12:33:32 +01:00
|
|
|
const data = {
|
|
|
|
email: `test_${randomString()}@mailtrap.freesewing.dev`,
|
|
|
|
language: 'en',
|
|
|
|
password: 'One two one two, this is just a test',
|
|
|
|
}
|
2022-11-01 18:00:25 +01:00
|
|
|
|
2022-11-02 12:33:32 +01:00
|
|
|
describe(`${user} Signup flow and authentication`, () => {
|
|
|
|
it(`${user} Should return 400 on signup without body`, (done) => {
|
2022-10-29 22:21:24 +02:00
|
|
|
chai
|
|
|
|
.request(config.api)
|
|
|
|
.post('/signup')
|
|
|
|
.send()
|
|
|
|
.end((err, res) => {
|
|
|
|
expect(err === null).to.equal(true)
|
|
|
|
expect(res.status).to.equal(400)
|
2022-11-01 18:00:25 +01:00
|
|
|
expect(res.body.result).to.equal(`error`)
|
|
|
|
expect(res.body.error).to.equal(`postBodyMissing`)
|
2022-10-29 22:21:24 +02:00
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2022-10-29 22:25:00 +02:00
|
|
|
Object.keys(data).map((key) => {
|
2022-11-02 12:33:32 +01:00
|
|
|
it(`${user} Should not allow signup without ${key}`, (done) => {
|
2022-10-29 22:21:24 +02:00
|
|
|
chai
|
|
|
|
.request(config.api)
|
|
|
|
.post('/signup')
|
2022-10-29 22:25:00 +02:00
|
|
|
.send(
|
|
|
|
Object.fromEntries(
|
|
|
|
Object.keys(data)
|
|
|
|
.filter((name) => name !== key)
|
|
|
|
.map((name) => [name, data[name]])
|
|
|
|
)
|
|
|
|
)
|
2022-10-29 22:21:24 +02:00
|
|
|
.end((err, res) => {
|
|
|
|
expect(err === null).to.equal(true)
|
|
|
|
expect(res.status).to.equal(400)
|
2022-10-31 17:54:49 +01:00
|
|
|
expect(res.type).to.equal('application/json')
|
|
|
|
expect(res.charset).to.equal('utf-8')
|
2022-11-01 18:00:25 +01:00
|
|
|
expect(res.body.result).to.equal(`error`)
|
2022-10-31 17:54:49 +01:00
|
|
|
expect(res.body.error).to.equal(`${key}Missing`)
|
2022-10-29 22:21:24 +02:00
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2022-11-02 12:33:32 +01:00
|
|
|
step(`${user} Should signup new user ${data.email}`, (done) => {
|
2022-10-29 22:21:24 +02:00
|
|
|
chai
|
|
|
|
.request(config.api)
|
|
|
|
.post('/signup')
|
2022-10-31 17:54:49 +01:00
|
|
|
.send({
|
|
|
|
...data,
|
2022-11-01 21:36:15 +01:00
|
|
|
unittest: true,
|
2022-10-31 17:54:49 +01:00
|
|
|
})
|
2022-10-29 22:21:24 +02:00
|
|
|
.end((err, res) => {
|
2022-11-01 18:00:25 +01:00
|
|
|
expect(res.status).to.equal(201)
|
2022-10-31 17:54:49 +01:00
|
|
|
expect(res.type).to.equal('application/json')
|
|
|
|
expect(res.charset).to.equal('utf-8')
|
2022-11-01 18:00:25 +01:00
|
|
|
expect(res.body.result).to.equal(`success`)
|
2022-11-02 12:33:32 +01:00
|
|
|
expect(res.body.email).to.equal(data.email)
|
2022-11-01 18:00:25 +01:00
|
|
|
store.confirmation = res.body.confirmation
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
2022-11-01 21:36:15 +01:00
|
|
|
|
2022-11-02 12:33:32 +01:00
|
|
|
step(`${user} Should confirm new user (${data.email})`, (done) => {
|
2022-11-01 18:00:25 +01:00
|
|
|
chai
|
|
|
|
.request(config.api)
|
|
|
|
.post(`/confirm/signup/${store.confirmation}`)
|
|
|
|
.send({ consent: 1 })
|
|
|
|
.end((err, res) => {
|
|
|
|
expect(res.status).to.equal(200)
|
|
|
|
expect(res.type).to.equal('application/json')
|
|
|
|
expect(res.charset).to.equal('utf-8')
|
|
|
|
expect(res.body.result).to.equal(`success`)
|
2022-11-01 21:36:15 +01:00
|
|
|
expect(typeof res.body.token).to.equal(`string`)
|
|
|
|
expect(typeof res.body.account.id).to.equal(`number`)
|
|
|
|
store.token = res.body.token
|
2022-11-02 12:33:32 +01:00
|
|
|
store.username = res.body.account.username
|
2022-11-02 12:47:13 +01:00
|
|
|
store.userid = res.body.account.id
|
2022-10-29 22:21:24 +02:00
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2022-11-02 12:33:32 +01:00
|
|
|
step(`${user} Should fail to signup an existing email address`, (done) => {
|
2022-10-29 22:21:24 +02:00
|
|
|
chai
|
2022-10-31 17:54:49 +01:00
|
|
|
.request(config.api)
|
2022-10-29 22:21:24 +02:00
|
|
|
.post('/signup')
|
2022-10-31 17:54:49 +01:00
|
|
|
.send(data)
|
2022-10-29 22:21:24 +02:00
|
|
|
.end((err, res) => {
|
2022-10-31 17:54:49 +01:00
|
|
|
expect(res.status).to.equal(400)
|
|
|
|
expect(res.type).to.equal('application/json')
|
|
|
|
expect(res.charset).to.equal('utf-8')
|
2022-11-01 18:00:25 +01:00
|
|
|
expect(res.body.result).to.equal(`error`)
|
2022-10-31 17:54:49 +01:00
|
|
|
expect(res.body.error).to.equal('emailExists')
|
2022-10-29 22:21:24 +02:00
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
2022-11-01 18:00:25 +01:00
|
|
|
|
2022-11-02 12:47:13 +01:00
|
|
|
step(`${user} Should not login with the wrong password`, (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.api)
|
|
|
|
.post('/login')
|
|
|
|
.send({
|
|
|
|
username: store.username,
|
|
|
|
password: store.username,
|
|
|
|
})
|
|
|
|
.end((err, res) => {
|
|
|
|
expect(res.status).to.equal(401)
|
|
|
|
expect(res.type).to.equal('application/json')
|
|
|
|
expect(res.charset).to.equal('utf-8')
|
|
|
|
expect(res.body.result).to.equal(`error`)
|
|
|
|
expect(res.body.error).to.equal(`loginFailed`)
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2022-11-02 12:33:32 +01:00
|
|
|
step(`${user} Should login with username and password`, (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.api)
|
|
|
|
.post('/login')
|
|
|
|
.send({
|
|
|
|
username: store.username,
|
2022-11-02 12:47:13 +01:00
|
|
|
password: data.password,
|
2022-11-02 12:33:32 +01:00
|
|
|
})
|
|
|
|
.end((err, res) => {
|
|
|
|
expect(res.status).to.equal(200)
|
|
|
|
expect(res.type).to.equal('application/json')
|
|
|
|
expect(res.charset).to.equal('utf-8')
|
|
|
|
expect(res.body.result).to.equal(`success`)
|
|
|
|
expect(res.body.account.email).to.equal(data.email)
|
|
|
|
expect(res.body.account.username).to.equal(store.username)
|
|
|
|
expect(res.body.account.lusername).to.equal(store.username.toLowerCase())
|
|
|
|
expect(typeof res.body.token).to.equal(`string`)
|
|
|
|
expect(typeof res.body.account.id).to.equal(`number`)
|
|
|
|
store.token = res.body.token
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2022-11-02 12:47:13 +01:00
|
|
|
step(`${user} Should login with USERNAME and password`, (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.api)
|
|
|
|
.post('/login')
|
|
|
|
.send({
|
|
|
|
username: store.username.toUpperCase(),
|
|
|
|
password: data.password,
|
|
|
|
})
|
|
|
|
.end((err, res) => {
|
|
|
|
expect(res.status).to.equal(200)
|
|
|
|
expect(res.type).to.equal('application/json')
|
|
|
|
expect(res.charset).to.equal('utf-8')
|
|
|
|
expect(res.body.result).to.equal(`success`)
|
|
|
|
expect(res.body.account.email).to.equal(data.email)
|
|
|
|
expect(res.body.account.username).to.equal(store.username)
|
|
|
|
expect(res.body.account.lusername).to.equal(store.username.toLowerCase())
|
|
|
|
expect(typeof res.body.token).to.equal(`string`)
|
|
|
|
expect(typeof res.body.account.id).to.equal(`number`)
|
|
|
|
store.token = res.body.token
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
2022-10-31 17:54:49 +01:00
|
|
|
|
2022-11-02 12:47:13 +01:00
|
|
|
step(`${user} Should login with email and password`, (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.api)
|
|
|
|
.post('/login')
|
|
|
|
.send({
|
|
|
|
username: data.email,
|
|
|
|
password: data.password,
|
|
|
|
})
|
|
|
|
.end((err, res) => {
|
|
|
|
expect(res.status).to.equal(200)
|
|
|
|
expect(res.type).to.equal('application/json')
|
|
|
|
expect(res.charset).to.equal('utf-8')
|
|
|
|
expect(res.body.result).to.equal(`success`)
|
|
|
|
expect(res.body.account.email).to.equal(data.email)
|
|
|
|
expect(res.body.account.username).to.equal(store.username)
|
|
|
|
expect(res.body.account.lusername).to.equal(store.username.toLowerCase())
|
|
|
|
expect(typeof res.body.token).to.equal(`string`)
|
|
|
|
expect(typeof res.body.account.id).to.equal(`number`)
|
|
|
|
store.token = res.body.token
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
2022-10-29 22:21:24 +02:00
|
|
|
|
2022-11-02 12:47:13 +01:00
|
|
|
step(`${user} Should login with EMAIL and password`, (done) => {
|
2022-10-29 22:21:24 +02:00
|
|
|
chai
|
2022-11-02 12:47:13 +01:00
|
|
|
.request(config.api)
|
2022-10-29 22:21:24 +02:00
|
|
|
.post('/login')
|
|
|
|
.send({
|
2022-11-02 12:47:13 +01:00
|
|
|
username: data.email.toUpperCase(),
|
|
|
|
password: data.password,
|
2022-10-29 22:21:24 +02:00
|
|
|
})
|
|
|
|
.end((err, res) => {
|
2022-11-02 12:47:13 +01:00
|
|
|
expect(res.status).to.equal(200)
|
|
|
|
expect(res.type).to.equal('application/json')
|
|
|
|
expect(res.charset).to.equal('utf-8')
|
|
|
|
expect(res.body.result).to.equal(`success`)
|
|
|
|
expect(res.body.account.email).to.equal(data.email)
|
|
|
|
expect(res.body.account.username).to.equal(store.username)
|
|
|
|
expect(res.body.account.lusername).to.equal(store.username.toLowerCase())
|
|
|
|
expect(typeof res.body.token).to.equal(`string`)
|
|
|
|
expect(typeof res.body.account.id).to.equal(`number`)
|
|
|
|
store.token = res.body.token
|
2022-10-29 22:21:24 +02:00
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2022-11-02 12:47:13 +01:00
|
|
|
step(`${user} Should login with userid and password`, (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.api)
|
|
|
|
.post('/login')
|
|
|
|
.send({
|
|
|
|
username: store.userid,
|
|
|
|
password: data.password,
|
|
|
|
})
|
|
|
|
.end((err, res) => {
|
|
|
|
expect(res.status).to.equal(200)
|
|
|
|
expect(res.type).to.equal('application/json')
|
|
|
|
expect(res.charset).to.equal('utf-8')
|
|
|
|
expect(res.body.result).to.equal(`success`)
|
|
|
|
expect(res.body.account.email).to.equal(data.email)
|
|
|
|
expect(res.body.account.username).to.equal(store.username)
|
|
|
|
expect(res.body.account.lusername).to.equal(store.username.toLowerCase())
|
|
|
|
expect(typeof res.body.token).to.equal(`string`)
|
|
|
|
expect(typeof res.body.account.id).to.equal(`number`)
|
|
|
|
store.token = res.body.token
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2022-11-02 13:54:20 +01:00
|
|
|
step(`${user} Should load account with JWT`, (done) => {
|
2022-11-02 12:47:13 +01:00
|
|
|
chai
|
|
|
|
.request(config.api)
|
2022-11-02 13:54:20 +01:00
|
|
|
.get('/account')
|
|
|
|
.set('Authorization', 'Bearer ' + store.token)
|
2022-11-02 12:47:13 +01:00
|
|
|
.end((err, res) => {
|
|
|
|
expect(res.status).to.equal(200)
|
|
|
|
expect(res.type).to.equal('application/json')
|
|
|
|
expect(res.charset).to.equal('utf-8')
|
|
|
|
expect(res.body.result).to.equal(`success`)
|
|
|
|
expect(res.body.account.email).to.equal(data.email)
|
|
|
|
expect(res.body.account.username).to.equal(store.username)
|
|
|
|
expect(res.body.account.lusername).to.equal(store.username.toLowerCase())
|
|
|
|
expect(typeof res.body.account.id).to.equal(`number`)
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2022-11-02 13:54:20 +01:00
|
|
|
/*
|
2022-11-02 12:47:13 +01:00
|
|
|
|
|
|
|
|
2022-10-29 22:21:24 +02:00
|
|
|
describe('Account management', () => {
|
|
|
|
it('should update the account avatar', (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.backend)
|
|
|
|
.put('/account')
|
|
|
|
.set('Authorization', 'Bearer ' + config.user.token)
|
|
|
|
.send({
|
|
|
|
avatar: config.avatar,
|
|
|
|
})
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(200)
|
|
|
|
let data = JSON.parse(res.text)
|
|
|
|
data.account.pictureUris.l.slice(-4).should.equal('.png')
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
it('should update the account username', (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.backend)
|
|
|
|
.put('/account')
|
|
|
|
.set('Authorization', 'Bearer ' + config.user.token)
|
|
|
|
.send({
|
|
|
|
username: config.user.username + '_updated',
|
|
|
|
})
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(200)
|
|
|
|
let data = JSON.parse(res.text)
|
|
|
|
data.account.username.should.equal(config.user.username + '_updated')
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should restore the account username', (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.backend)
|
|
|
|
.put('/account')
|
|
|
|
.set('Authorization', 'Bearer ' + config.user.token)
|
|
|
|
.send({
|
|
|
|
username: config.user.username,
|
|
|
|
})
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(200)
|
|
|
|
let data = JSON.parse(res.text)
|
|
|
|
data.account.username.should.equal(config.user.username)
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should not update the account username if that username is taken', (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.backend)
|
|
|
|
.put('/account')
|
|
|
|
.set('Authorization', 'Bearer ' + config.user.token)
|
|
|
|
.send({
|
|
|
|
username: 'admin',
|
|
|
|
})
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(400)
|
|
|
|
res.text.should.equal('usernameTaken')
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should update the account bio', (done) => {
|
|
|
|
let bio = 'This is the test bio '
|
|
|
|
chai
|
|
|
|
.request(config.backend)
|
|
|
|
.put('/account')
|
|
|
|
.set('Authorization', 'Bearer ' + config.user.token)
|
|
|
|
.send({
|
|
|
|
bio: bio,
|
|
|
|
})
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(200)
|
|
|
|
let data = JSON.parse(res.text)
|
|
|
|
data.account.bio.should.equal(bio)
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should update the account language', (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.backend)
|
|
|
|
.put('/account')
|
|
|
|
.set('Authorization', 'Bearer ' + config.user.token)
|
|
|
|
.send({
|
|
|
|
settings: {
|
|
|
|
language: 'nl',
|
|
|
|
},
|
|
|
|
})
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(200)
|
|
|
|
let data = JSON.parse(res.text)
|
|
|
|
data.account.settings.language.should.equal('nl')
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should update the account units', (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.backend)
|
|
|
|
.put('/account')
|
|
|
|
.set('Authorization', 'Bearer ' + config.user.token)
|
|
|
|
.send({
|
|
|
|
settings: {
|
|
|
|
units: 'imperial',
|
|
|
|
},
|
|
|
|
})
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(200)
|
|
|
|
let data = JSON.parse(res.text)
|
|
|
|
data.account.settings.units.should.equal('imperial')
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
for (let network of ['github', 'twitter', 'instagram']) {
|
|
|
|
it(`should update the account's ${network} username`, (done) => {
|
|
|
|
let data = { social: {} }
|
|
|
|
data.social[network] = network
|
|
|
|
chai
|
|
|
|
.request(config.backend)
|
|
|
|
.put('/account')
|
|
|
|
.set('Authorization', 'Bearer ' + config.user.token)
|
|
|
|
.send(data)
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(200)
|
|
|
|
JSON.parse(res.text).account.social[network].should.equal(network)
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
it('should update the account password', (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.backend)
|
|
|
|
.put('/account')
|
|
|
|
.set('Authorization', 'Bearer ' + config.user.token)
|
|
|
|
.send({
|
|
|
|
password: 'changeme',
|
|
|
|
})
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(200)
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should login with the new password', (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.backend)
|
|
|
|
.post('/login')
|
|
|
|
.send({
|
|
|
|
username: config.user.username,
|
|
|
|
password: 'changeme',
|
|
|
|
})
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(200)
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should restore the account password', (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.backend)
|
|
|
|
.put('/account')
|
|
|
|
.set('Authorization', 'Bearer ' + config.user.token)
|
|
|
|
.send({
|
|
|
|
password: config.user.password,
|
|
|
|
})
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(200)
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('Other user endpoints', () => {
|
|
|
|
it("should load a user's profile", (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.backend)
|
|
|
|
.get('/users/admin')
|
|
|
|
.set('Authorization', 'Bearer ' + config.user.token)
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(200)
|
|
|
|
let data = JSON.parse(res.text)
|
|
|
|
data.username.should.equal('admin')
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should confirm that a username is available', (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.backend)
|
|
|
|
.post('/available/username')
|
|
|
|
.set('Authorization', 'Bearer ' + config.user.token)
|
|
|
|
.send({
|
|
|
|
username: Date.now() + ' ' + Date.now(),
|
|
|
|
})
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(200)
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should confirm that a username is not available', (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.backend)
|
|
|
|
.post('/available/username')
|
|
|
|
.set('Authorization', 'Bearer ' + config.user.token)
|
|
|
|
.send({
|
|
|
|
username: 'admin',
|
|
|
|
})
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(400)
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should load the patron list', (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.backend)
|
|
|
|
.get('/patrons')
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(200)
|
|
|
|
let data = JSON.parse(res.text)
|
|
|
|
data['2'].should.be.an('array')
|
|
|
|
data['4'].should.be.an('array')
|
|
|
|
data['8'].should.be.an('array')
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should export the user data', (done) => {
|
|
|
|
chai
|
|
|
|
.request(config.backend)
|
|
|
|
.get('/account/export')
|
|
|
|
.set('Authorization', 'Bearer ' + config.user.token)
|
|
|
|
.end((err, res) => {
|
|
|
|
res.should.have.status(200)
|
|
|
|
let data = JSON.parse(res.text)
|
|
|
|
data.export.should.be.a('string')
|
|
|
|
store.exportLink = data.export
|
|
|
|
done()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
*/
|
|
|
|
})
|