mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
test: fix tests
This commit is contained in:
@@ -42,6 +42,8 @@
|
||||
"flags": "Flags",
|
||||
"flag-details": "Flag %1 Details",
|
||||
|
||||
"world": "World",
|
||||
|
||||
"account/edit": "Editing \"%1\"",
|
||||
"account/edit/password": "Editing password of \"%1\"",
|
||||
"account/edit/username": "Editing username of \"%1\"",
|
||||
|
||||
@@ -7,6 +7,9 @@ PostObject:
|
||||
tid:
|
||||
type: number
|
||||
description: A topic identifier
|
||||
toPid:
|
||||
type: number
|
||||
description: The post that this post is in reply to
|
||||
content:
|
||||
type: string
|
||||
uid:
|
||||
|
||||
@@ -324,5 +324,9 @@ paths:
|
||||
$ref: 'read/groups/slug.yaml'
|
||||
"/api/groups/{slug}/members":
|
||||
$ref: 'read/groups/slug/members.yaml'
|
||||
"/api/world":
|
||||
$ref: 'read/world.yaml'
|
||||
"/api/world/{filter}":
|
||||
$ref: 'read/world.yaml'
|
||||
/api/outgoing:
|
||||
$ref: 'read/outgoing.yaml'
|
||||
@@ -59,6 +59,9 @@ get:
|
||||
tid:
|
||||
type: number
|
||||
description: A topic identifier
|
||||
toPid:
|
||||
type: number
|
||||
description: The post that this post is in reply to
|
||||
content:
|
||||
type: string
|
||||
timestamp:
|
||||
@@ -84,6 +87,13 @@ get:
|
||||
type: string
|
||||
index:
|
||||
type: number
|
||||
parent:
|
||||
type: object
|
||||
properties:
|
||||
username:
|
||||
type: string
|
||||
displayname:
|
||||
type: string
|
||||
user:
|
||||
type: object
|
||||
properties:
|
||||
|
||||
117
public/openapi/read/world.yaml
Normal file
117
public/openapi/read/world.yaml
Normal file
@@ -0,0 +1,117 @@
|
||||
get:
|
||||
tags:
|
||||
- topics
|
||||
summary: Get external topics
|
||||
description: Returns a list of external topics known to the local instance
|
||||
responses:
|
||||
"200":
|
||||
description: An array of topic objects sorted by timestamp.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
allOf:
|
||||
- type: object
|
||||
properties:
|
||||
topicCount:
|
||||
type: number
|
||||
topics:
|
||||
type: array
|
||||
items:
|
||||
$ref: ../components/schemas/TopicObject.yaml#/TopicObject
|
||||
# tids:
|
||||
# type: array
|
||||
# items:
|
||||
# type: number
|
||||
# canPost:
|
||||
# type: boolean
|
||||
# showSelect:
|
||||
# type: boolean
|
||||
# showTopicTools:
|
||||
# type: boolean
|
||||
# allCategoriesUrl:
|
||||
# type: string
|
||||
# selectedCategory:
|
||||
# type: object
|
||||
# properties:
|
||||
# icon:
|
||||
# type: string
|
||||
# name:
|
||||
# type: string
|
||||
# bgColor:
|
||||
# type: string
|
||||
# nullable: true
|
||||
# selectedCids:
|
||||
# type: array
|
||||
# items:
|
||||
# type: number
|
||||
# selectedTag:
|
||||
# type: object
|
||||
# properties:
|
||||
# label:
|
||||
# type: string
|
||||
# nullable: true
|
||||
# selectedTags:
|
||||
# type: array
|
||||
# items:
|
||||
# type: string
|
||||
# feeds:disableRSS:
|
||||
# type: number
|
||||
# rssFeedUrl:
|
||||
# type: string
|
||||
# title:
|
||||
# type: string
|
||||
# filters:
|
||||
# type: array
|
||||
# items:
|
||||
# type: object
|
||||
# properties:
|
||||
# name:
|
||||
# type: string
|
||||
# url:
|
||||
# type: string
|
||||
# selected:
|
||||
# type: boolean
|
||||
# filter:
|
||||
# type: string
|
||||
# icon:
|
||||
# type: string
|
||||
# selectedFilter:
|
||||
# type: object
|
||||
# properties:
|
||||
# name:
|
||||
# type: string
|
||||
# url:
|
||||
# type: string
|
||||
# selected:
|
||||
# type: boolean
|
||||
# filter:
|
||||
# type: string
|
||||
# icon:
|
||||
# type: string
|
||||
# terms:
|
||||
# type: array
|
||||
# items:
|
||||
# type: object
|
||||
# properties:
|
||||
# name:
|
||||
# type: string
|
||||
# url:
|
||||
# type: string
|
||||
# selected:
|
||||
# type: boolean
|
||||
# term:
|
||||
# type: string
|
||||
# selectedTerm:
|
||||
# type: object
|
||||
# properties:
|
||||
# name:
|
||||
# type: string
|
||||
# url:
|
||||
# type: string
|
||||
# selected:
|
||||
# type: boolean
|
||||
# term:
|
||||
# type: string
|
||||
- $ref: ../components/schemas/Pagination.yaml#/Pagination
|
||||
- $ref: ../components/schemas/Breadcrumbs.yaml#/Breadcrumbs
|
||||
- $ref: ../components/schemas/CommonProps.yaml#/CommonProps
|
||||
@@ -32,6 +32,9 @@ get:
|
||||
tid:
|
||||
type: number
|
||||
description: A topic identifier
|
||||
toPid:
|
||||
type: number
|
||||
description: The post that this post is in reply to
|
||||
content:
|
||||
type: string
|
||||
timestamp:
|
||||
|
||||
@@ -38,6 +38,9 @@ get:
|
||||
tid:
|
||||
type: number
|
||||
description: A topic identifier
|
||||
toPid:
|
||||
type: number
|
||||
description: The post that this post is in reply to
|
||||
content:
|
||||
type: string
|
||||
uid:
|
||||
|
||||
@@ -32,6 +32,8 @@ controller.list = async function (req, res) {
|
||||
data.topics = await topics.getTopicsByTids(tids, { uid: req.uid });
|
||||
topics.calculateTopicIndices(data.topics, start);
|
||||
|
||||
data.breadcrumbs = helpers.buildBreadcrumbs([{ text: `[[pages:world]]` }]);
|
||||
|
||||
const pageCount = Math.max(1, Math.ceil(data.topicCount / topicsPerPage));
|
||||
data.pagination = pagination.create(page, pageCount, req.query);
|
||||
helpers.addLinkTags({
|
||||
|
||||
@@ -65,7 +65,7 @@ recentController.getData = async function (req, url, sort) {
|
||||
data.title = meta.config.homePageTitle || '[[pages:home]]';
|
||||
} else {
|
||||
data.title = `[[pages:${url}]]`;
|
||||
data.breadcrumbs = helpers.buildBreadcrumbs([{ text: `[[${url}:title]]` }]);
|
||||
data.breadcrumbs = helpers.buildBreadcrumbs([{ text: `[[activitypub:world-title]]` }]);
|
||||
}
|
||||
|
||||
const query = { ...req.query };
|
||||
|
||||
@@ -241,6 +241,7 @@ describe('API', async () => {
|
||||
meta.config.allowTopicsThumbnail = 1;
|
||||
meta.config.termsOfUse = 'I, for one, welcome our new test-driven overlords';
|
||||
meta.config.chatMessageDelay = 0;
|
||||
meta.config.activitypubEnabled = 1;
|
||||
|
||||
// Create a category
|
||||
const testCategory = await categories.create({ name: 'test' });
|
||||
|
||||
Reference in New Issue
Block a user