Skip to content

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.yaml
index c2861df591..11d072ed54 100644
--- a/public/openapi/read.yaml
+++ b/public/openapi/read.yaml
@@ -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:
diff --git a/test/api.js b/test/api.js
index 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 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',