mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	test: fix tests
This commit is contained in:
		| @@ -42,6 +42,8 @@ | |||||||
| 	"flags": "Flags", | 	"flags": "Flags", | ||||||
| 	"flag-details": "Flag %1 Details", | 	"flag-details": "Flag %1 Details", | ||||||
|  |  | ||||||
|  | 	"world": "World", | ||||||
|  |  | ||||||
| 	"account/edit": "Editing \"%1\"", | 	"account/edit": "Editing \"%1\"", | ||||||
| 	"account/edit/password": "Editing password of \"%1\"", | 	"account/edit/password": "Editing password of \"%1\"", | ||||||
| 	"account/edit/username": "Editing username of \"%1\"", | 	"account/edit/username": "Editing username of \"%1\"", | ||||||
|   | |||||||
| @@ -7,6 +7,9 @@ PostObject: | |||||||
|     tid: |     tid: | ||||||
|       type: number |       type: number | ||||||
|       description: A topic identifier |       description: A topic identifier | ||||||
|  |     toPid: | ||||||
|  |       type: number | ||||||
|  |       description: The post that this post is in reply to | ||||||
|     content: |     content: | ||||||
|       type: string |       type: string | ||||||
|     uid: |     uid: | ||||||
|   | |||||||
| @@ -324,5 +324,9 @@ paths: | |||||||
|     $ref: 'read/groups/slug.yaml' |     $ref: 'read/groups/slug.yaml' | ||||||
|   "/api/groups/{slug}/members": |   "/api/groups/{slug}/members": | ||||||
|     $ref: 'read/groups/slug/members.yaml' |     $ref: 'read/groups/slug/members.yaml' | ||||||
|  |   "/api/world": | ||||||
|  |     $ref: 'read/world.yaml' | ||||||
|  |   "/api/world/{filter}": | ||||||
|  |     $ref: 'read/world.yaml' | ||||||
|   /api/outgoing: |   /api/outgoing: | ||||||
|     $ref: 'read/outgoing.yaml' |     $ref: 'read/outgoing.yaml' | ||||||
| @@ -59,6 +59,9 @@ get: | |||||||
|                         tid: |                         tid: | ||||||
|                           type: number |                           type: number | ||||||
|                           description: A topic identifier |                           description: A topic identifier | ||||||
|  |                         toPid: | ||||||
|  |                           type: number | ||||||
|  |                           description: The post that this post is in reply to | ||||||
|                         content: |                         content: | ||||||
|                           type: string |                           type: string | ||||||
|                         timestamp: |                         timestamp: | ||||||
| @@ -84,6 +87,13 @@ get: | |||||||
|                           type: string |                           type: string | ||||||
|                         index: |                         index: | ||||||
|                           type: number |                           type: number | ||||||
|  |                         parent: | ||||||
|  |                           type: object | ||||||
|  |                           properties: | ||||||
|  |                             username: | ||||||
|  |                               type: string | ||||||
|  |                             displayname: | ||||||
|  |                               type: string | ||||||
|                         user: |                         user: | ||||||
|                           type: object |                           type: object | ||||||
|                           properties: |                           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: |                   tid: | ||||||
|                     type: number |                     type: number | ||||||
|                     description: A topic identifier |                     description: A topic identifier | ||||||
|  |                   toPid: | ||||||
|  |                     type: number | ||||||
|  |                     description: The post that this post is in reply to | ||||||
|                   content: |                   content: | ||||||
|                     type: string |                     type: string | ||||||
|                   timestamp: |                   timestamp: | ||||||
|   | |||||||
| @@ -38,6 +38,9 @@ get: | |||||||
|                   tid: |                   tid: | ||||||
|                     type: number |                     type: number | ||||||
|                     description: A topic identifier |                     description: A topic identifier | ||||||
|  |                   toPid: | ||||||
|  |                     type: number | ||||||
|  |                     description: The post that this post is in reply to | ||||||
|                   content: |                   content: | ||||||
|                     type: string |                     type: string | ||||||
|                   uid: |                   uid: | ||||||
|   | |||||||
| @@ -32,6 +32,8 @@ controller.list = async function (req, res) { | |||||||
| 	data.topics = await topics.getTopicsByTids(tids, { uid: req.uid }); | 	data.topics = await topics.getTopicsByTids(tids, { uid: req.uid }); | ||||||
| 	topics.calculateTopicIndices(data.topics, start); | 	topics.calculateTopicIndices(data.topics, start); | ||||||
|  |  | ||||||
|  | 	data.breadcrumbs = helpers.buildBreadcrumbs([{ text: `[[pages:world]]` }]); | ||||||
|  |  | ||||||
| 	const pageCount = Math.max(1, Math.ceil(data.topicCount / topicsPerPage)); | 	const pageCount = Math.max(1, Math.ceil(data.topicCount / topicsPerPage)); | ||||||
| 	data.pagination = pagination.create(page, pageCount, req.query); | 	data.pagination = pagination.create(page, pageCount, req.query); | ||||||
| 	helpers.addLinkTags({ | 	helpers.addLinkTags({ | ||||||
|   | |||||||
| @@ -65,7 +65,7 @@ recentController.getData = async function (req, url, sort) { | |||||||
| 		data.title = meta.config.homePageTitle || '[[pages:home]]'; | 		data.title = meta.config.homePageTitle || '[[pages:home]]'; | ||||||
| 	} else { | 	} else { | ||||||
| 		data.title = `[[pages:${url}]]`; | 		data.title = `[[pages:${url}]]`; | ||||||
| 		data.breadcrumbs = helpers.buildBreadcrumbs([{ text: `[[${url}:title]]` }]); | 		data.breadcrumbs = helpers.buildBreadcrumbs([{ text: `[[activitypub:world-title]]` }]); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	const query = { ...req.query }; | 	const query = { ...req.query }; | ||||||
|   | |||||||
| @@ -241,6 +241,7 @@ describe('API', async () => { | |||||||
| 		meta.config.allowTopicsThumbnail = 1; | 		meta.config.allowTopicsThumbnail = 1; | ||||||
| 		meta.config.termsOfUse = 'I, for one, welcome our new test-driven overlords'; | 		meta.config.termsOfUse = 'I, for one, welcome our new test-driven overlords'; | ||||||
| 		meta.config.chatMessageDelay = 0; | 		meta.config.chatMessageDelay = 0; | ||||||
|  | 		meta.config.activitypubEnabled = 1; | ||||||
|  |  | ||||||
| 		// Create a category | 		// Create a category | ||||||
| 		const testCategory = await categories.create({ name: 'test' }); | 		const testCategory = await categories.create({ name: 'test' }); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user