Node.js based forum software built for the modern web
fix: tests
Barış Soner Uşaklıf03ca0867b2d
diff --git a/public/openapi/read.yaml b/public/openapi/read.yamlindex c2861df591..11d072ed54 100644--- a/public/openapi/read.yaml+++ b/public/openapi/read.yaml@@ -7636,29 +7636,14 @@ paths:items:type: objectproperties:- type:- type: stringbodyShort:type: string- bodyLong:- type: string- pid:- oneOf:- - type: number- - type: string- tid:- type: number- description: A topic identifierpath:type: stringnid:type: stringfrom:type: number- mergeId:- type: string- topicTitle:- type: stringimportance:type: numberdatetime:@@ -7677,6 +7662,7 @@ paths:removed, etc.)picture:type: string+ nullable: trueuid:type: numberdescription: A user identifier@@ -7694,12 +7680,11 @@ paths:example: "#f44336"image:type: string+ nullable: trueread:type: booleanreadClass:type: string- subject:- type: stringfilters:type: arrayitems:diff --git a/test/api.js b/test/api.jsindex 92bdbe7358..435d0ab183 100644--- a/test/api.js+++ b/test/api.js@@ -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 roomawait 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 enabledplugins.registerHook('core', {hook: 'filter:search.query',