fix: tests

v1.18.x
Barış Soner Uşaklı 5 years ago
parent 8383992dcc
commit f03ca0867b

@ -7636,29 +7636,14 @@ paths:
items:
type: object
properties:
type:
type: string
bodyShort:
type: string
bodyLong:
type: string
pid:
oneOf:
- type: number
- type: string
tid:
type: number
description: A topic identifier
path:
type: string
nid:
type: string
from:
type: number
mergeId:
type: string
topicTitle:
type: string
importance:
type: number
datetime:
@ -7677,6 +7662,7 @@ paths:
removed, etc.)
picture:
type: string
nullable: true
uid:
type: number
description: A user identifier
@ -7694,12 +7680,11 @@ paths:
example: "#f44336"
image:
type: string
nullable: true
read:
type: boolean
readClass:
type: string
subject:
type: string
filters:
type: array
items:

@ -5,6 +5,8 @@ const path = require('path');
const SwaggerParser = require('@apidevtools/swagger-parser');
const request = require('request-promise-native');
const nconf = require('nconf');
const util = require('util');
const wait = util.promisify(setTimeout);
const db = require('./mocks/databasemock');
const helpers = require('./helpers');
@ -15,6 +17,7 @@ const topics = require('../src/topics');
const plugins = require('../src/plugins');
const flags = require('../src/flags');
const messaging = require('../src/messaging');
const socketUser = require('../src/socket.io/user');
describe('Read API', async () => {
let readApi = false;
@ -58,6 +61,13 @@ describe('Read API', async () => {
// Create a new chat room
await messaging.newRoom(1, [2]);
// export data for admin user
await socketUser.exportProfile({ uid: adminUid }, { uid: adminUid });
await socketUser.exportPosts({ uid: adminUid }, { uid: adminUid });
await socketUser.exportUploads({ uid: adminUid }, { uid: adminUid });
// wait for export child process to complete
await wait(2000);
// Attach a search hook so /api/search is enabled
plugins.registerHook('core', {
hook: 'filter:search.query',

Loading…
Cancel
Save