fix: tests

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

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

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

Loading…
Cancel
Save