mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
Moving settings to mocks.
This commit is contained in:
@@ -2,6 +2,7 @@ const Comments = require('../../models/comment');
|
||||
const Users = require('../../models/user');
|
||||
const Actions = require('../../models/action');
|
||||
const Assets = require('../../models/asset');
|
||||
const Settings = require('../../models/setting');
|
||||
const globals = require('./globals');
|
||||
|
||||
/* Create an array of comments */
|
||||
@@ -19,3 +20,6 @@ module.exports.users = (users) => Users.createLocalUsers(users);
|
||||
|
||||
/* Create an array of actions */
|
||||
module.exports.actions = (actions) => Actions.create(actions);
|
||||
|
||||
/* Update a setting */
|
||||
module.exports.settings = (setting) => Settings.init().then(() => Settings.updateSettings(setting));
|
||||
|
||||
@@ -16,7 +16,7 @@ module.exports = {
|
||||
},
|
||||
'User registers and posts a comment with premod off': client => {
|
||||
client.perform((client, done) => {
|
||||
client.page.embedStream().setConfig({moderation: 'post'}, client.globals.baseUrl)
|
||||
mocks.settings({moderation: 'pre'})
|
||||
.then(() => {
|
||||
//Load Page
|
||||
client.resizeWindow(1200, 800)
|
||||
@@ -52,7 +52,7 @@ module.exports = {
|
||||
},
|
||||
'User posts a comment with premod on': client => {
|
||||
client.perform((client, done) => {
|
||||
client.page.embedStream().setConfig({moderation: 'pre'}, client.globals.baseUrl)
|
||||
mocks.settings({moderation: 'pre'})
|
||||
.then(() => {
|
||||
//Load Page
|
||||
client.url(client.globals.baseUrl)
|
||||
@@ -73,7 +73,7 @@ module.exports = {
|
||||
},
|
||||
'User replies to a comment with premod off': client => {
|
||||
client.perform((client, done) => {
|
||||
client.page.embedStream().setConfig({moderation: 'post'}, client.globals.baseUrl)
|
||||
mocks.settings({moderation: 'pre'})
|
||||
.then(() => {
|
||||
//Load Page
|
||||
client.resizeWindow(1200, 800)
|
||||
@@ -96,7 +96,7 @@ module.exports = {
|
||||
},
|
||||
'User replies to a comment with premod on': client => {
|
||||
client.perform((client, done) => {
|
||||
client.page.embedStream().setConfig({moderation: 'pre'}, client.globals.baseUrl)
|
||||
mocks.settings({moderation: 'pre'})
|
||||
// Add a mock user
|
||||
.then(() => mocks.users([{
|
||||
displayName: 'Baby Blue',
|
||||
|
||||
Reference in New Issue
Block a user