From 4327835714f360a6aed8d49c6ec1806bd4606dd2 Mon Sep 17 00:00:00 2001 From: Kathy Tran Date: Thu, 16 Jan 2025 10:06:52 -0500 Subject: [PATCH] Add entryTypeMetadata to search hits in tests --- .../e2e/immutableDatabaseTests/searchTable.ts | 40 +++++++++++++++ cypress/fixtures/searchTableResponse.json | 50 +++++++++++++++++++ src/app/test/mocked-objects.ts | 20 ++++++++ 3 files changed, 110 insertions(+) diff --git a/cypress/e2e/immutableDatabaseTests/searchTable.ts b/cypress/e2e/immutableDatabaseTests/searchTable.ts index e71196d1ef..cecbaaeb88 100644 --- a/cypress/e2e/immutableDatabaseTests/searchTable.ts +++ b/cypress/e2e/immutableDatabaseTests/searchTable.ts @@ -37,6 +37,16 @@ describe('Dockstore tool/workflow search table', () => { _id: '52', _score: 1.0, _source: { + entryTypeMetadata: { + termPlural: 'tools', + sitePath: 'containers', + trsSupported: true, + trsPrefix: '', + term: 'tool', + searchSupported: true, + type: 'TOOL', + searchEntryType: 'tools', + }, tool_maintainer_email: '', aliases: {}, default_dockerfile_path: '/Dockerfile', @@ -102,6 +112,16 @@ describe('Dockstore tool/workflow search table', () => { _id: '5', _score: 1.0, _source: { + entryTypeMetadata: { + termPlural: 'tools', + sitePath: 'containers', + trsSupported: true, + trsPrefix: '', + term: 'tool', + searchSupported: true, + type: 'TOOL', + searchEntryType: 'tools', + }, tool_maintainer_email: '', aliases: {}, default_dockerfile_path: '/Dockerfile', @@ -190,6 +210,16 @@ describe('Dockstore tool/workflow search table', () => { _id: '4', _score: 1.0, _source: { + entryTypeMetadata: { + termPlural: 'tools', + sitePath: 'containers', + trsSupported: true, + trsPrefix: '', + term: 'tool', + searchSupported: true, + type: 'TOOL', + searchEntryType: 'tools', + }, tool_maintainer_email: '', aliases: {}, default_dockerfile_path: '/Dockerfile', @@ -278,6 +308,16 @@ describe('Dockstore tool/workflow search table', () => { _id: '11', _score: 1.0, _source: { + entryTypeMetadata: { + termPlural: 'workflows', + sitePath: 'workflows', + trsSupported: true, + trsPrefix: '#workflow/', + term: 'workflow', + searchSupported: true, + type: 'WORKFLOW', + searchEntryType: 'workflows', + }, aliases: {}, is_published: true, last_modified_date: null, diff --git a/cypress/fixtures/searchTableResponse.json b/cypress/fixtures/searchTableResponse.json index 21c4f2975b..6c9439216a 100644 --- a/cypress/fixtures/searchTableResponse.json +++ b/cypress/fixtures/searchTableResponse.json @@ -17,6 +17,16 @@ "_id": "52", "_score": 1.0, "_source": { + "entryTypeMetadata": { + "termPlural": "tools", + "sitePath": "containers", + "trsSupported": true, + "trsPrefix": "", + "term": "tool", + "searchSupported": true, + "type": "TOOL", + "searchEntryType": "tools" + }, "tool_maintainer_email": "", "aliases": {}, "default_dockerfile_path": "/Dockerfile", @@ -89,6 +99,16 @@ "_id": "5", "_score": 1.0, "_source": { + "entryTypeMetadata": { + "termPlural": "tools", + "sitePath": "containers", + "trsSupported": true, + "trsPrefix": "", + "term": "tool", + "searchSupported": true, + "type": "TOOL", + "searchEntryType": "tools" + }, "tool_maintainer_email": "", "aliases": {}, "default_dockerfile_path": "/Dockerfile", @@ -179,6 +199,16 @@ "_id": "4", "_score": 1.0, "_source": { + "entryTypeMetadata": { + "termPlural": "tools", + "sitePath": "containers", + "trsSupported": true, + "trsPrefix": "", + "term": "tool", + "searchSupported": true, + "type": "TOOL", + "searchEntryType": "tools" + }, "tool_maintainer_email": "", "aliases": {}, "default_dockerfile_path": "/Dockerfile", @@ -270,6 +300,16 @@ "_id": "11", "_score": 1.0, "_source": { + "entryTypeMetadata": { + "termPlural": "workflows", + "sitePath": "workflows", + "trsSupported": true, + "trsPrefix": "#workflow/", + "term": "workflow", + "searchSupported": true, + "type": "WORKFLOW", + "searchEntryType": "workflows" + }, "aliases": {}, "is_published": true, "last_modified_date": null, @@ -333,6 +373,16 @@ "_id": "61", "_score": 1.0, "_source": { + "entryTypeMetadata": { + "termPlural": "notebooks", + "sitePath": "notebooks", + "trsSupported": true, + "trsPrefix": "#notebook/", + "term": "notebook", + "searchSupported": true, + "type": "NOTEBOOK", + "searchEntryType": "notebooks" + }, "aliases": {}, "is_published": true, "last_modified_date": null, diff --git a/src/app/test/mocked-objects.ts b/src/app/test/mocked-objects.ts index 9ddc2a1a8e..1f354e3c9d 100644 --- a/src/app/test/mocked-objects.ts +++ b/src/app/test/mocked-objects.ts @@ -639,6 +639,16 @@ export const elasticSearchResponse: Hit[] = [ _id: '2313', _score: 1, _source: { + entryTypeMetadata: { + termPlural: 'tools', + sitePath: 'containers', + trsSupported: true, + trsPrefix: '', + term: 'tool', + searchSupported: true, + type: 'TOOL', + searchEntryType: 'tools', + }, tool_maintainer_email: '', aliases: {}, default_dockerfile_path: '/delly_docker/Dockerfile', @@ -722,6 +732,16 @@ export const elasticSearchResponse: Hit[] = [ _id: '2210', _score: 1, _source: { + entryTypeMetadata: { + termPlural: 'workflows', + sitePath: 'workflows', + trsSupported: true, + trsPrefix: '#workflow/', + term: 'workflow', + searchSupported: true, + type: 'WORKFLOW', + searchEntryType: 'workflows', + }, aliases: {}, is_published: true, last_modified_date: null,