mirror of
https://github.com/wassname/talk.git
synced 2026-08-16 11:29:31 +08:00
Merge branch 'master' into gdpr-password
This commit is contained in:
@@ -96,12 +96,6 @@ module.exports = {
|
||||
|
||||
comments.logout();
|
||||
},
|
||||
'not logged in user clicks my profile tab': client => {
|
||||
const embedStream = client.page.embedStream();
|
||||
const profile = embedStream.goToProfileSection();
|
||||
|
||||
profile.assert.visible('@notLoggedIn');
|
||||
},
|
||||
'admin logs in': client => {
|
||||
const { testData: { admin } } = client.globals;
|
||||
const embedStream = client.page.embedStream();
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
const mongoose = require('../services/mongoose');
|
||||
|
||||
beforeAll(function(done) {
|
||||
mongoose.connection.on('open', function(err) {
|
||||
if (err) {
|
||||
return done(err);
|
||||
}
|
||||
|
||||
return done();
|
||||
});
|
||||
}, 30000);
|
||||
|
||||
beforeEach(async () => {
|
||||
await Promise.all(
|
||||
Object.keys(mongoose.connection.collections).map(collection => {
|
||||
return new Promise((resolve, reject) => {
|
||||
mongoose.connection.collections[collection].remove(function(err) {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
|
||||
return resolve();
|
||||
});
|
||||
});
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
afterAll(async function() {
|
||||
await mongoose.disconnect();
|
||||
});
|
||||
Reference in New Issue
Block a user