fix: csv test

v1.18.x
Barış Soner Uşaklı 4 years ago
parent 700ef1af97
commit 3de692cd52

@ -264,16 +264,22 @@ describe('Admin Controllers', function () {
});
it('should load /admin/users/csv', function (done) {
request(nconf.get('url') + '/api/admin/users/csv', {
jar: jar,
headers: {
referer: nconf.get('url') + '/admin/manage/users',
},
}, function (err, res, body) {
assert.ifError(err);
assert.equal(res.statusCode, 200);
assert(body);
done();
const socketAdmin = require('../src/socket.io/admin');
socketAdmin.user.exportUsersCSV({ uid: adminUid }, {}, function (err) {
assert.ifError(err);
setTimeout(function () {
request(nconf.get('url') + '/api/admin/users/csv', {
jar: jar,
headers: {
referer: nconf.get('url') + '/admin/manage/users',
},
}, function (err, res, body) {
assert.ifError(err);
assert.equal(res.statusCode, 200);
assert(body);
done();
});
}, 2000);
});
});

Loading…
Cancel
Save