Skip to content

Commit

Permalink
Refactor dataset field mapping to use plural form for proposal and sa…
Browse files Browse the repository at this point in the history
…mple IDs
  • Loading branch information
Junjiequan committed Sep 19, 2024
1 parent e246213 commit 5399365
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/elastic-search/configuration/datasetFieldMapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ export const datasetMappings: MappingObject = {
type: "nested",
dynamic: false,
},
proposalId: {
proposalIds: {
type: "keyword",
ignore_above: 256,
},
sampleId: {
sampleIds: {
type: "keyword",
ignore_above: 256,
},
Expand Down
16 changes: 8 additions & 8 deletions test/ElasticSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ const scientificMetadata = (values) => {
});
});

it("0030: should fetching dataset with correct proposalId and size", async () => {
it("0030: should fetching dataset with correct proposalIds and size", async () => {
return request(appUrl)
.post("/api/v3/elastic-search/search")
.send({
proposalId: TestData.ScientificMetadataForElasticSearch.proposalId,
proposalIds: TestData.ScientificMetadataForElasticSearch.proposalId,
size: TestData.ScientificMetadataForElasticSearch.size,
})
.set("Accept", "application/json")
Expand All @@ -194,11 +194,11 @@ const scientificMetadata = (values) => {
});
});

it("0031: should fail fetching dataset with correct proposalId but wrong size", async () => {
it("0031: should fail fetching dataset with correct proposalIds but wrong size", async () => {
return request(appUrl)
.post("/api/v3/elastic-search/search")
.send({
proposalId: TestData.ScientificMetadataForElasticSearch.proposalId,
proposalIds: [TestData.ScientificMetadataForElasticSearch.proposalId],
size: faker.number.int({ min: 100000001, max: 100400000 }),
})
.set("Accept", "application/json")
Expand All @@ -209,11 +209,11 @@ const scientificMetadata = (values) => {
res.body.data.should.be.length(0);
});
});
it("0032: should fail fetching dataset with wrong proposalId but correct size", async () => {
it("0032: should fail fetching dataset with wrong proposalIds but correct size", async () => {
return request(appUrl)
.post("/api/v3/elastic-search/search")
.send({
proposalId: "wrongProposalId",
proposalIds: ["wrongProposalId"],
size: TestData.ScientificMetadataForElasticSearch.size,
})
.set("Accept", "application/json")
Expand All @@ -225,11 +225,11 @@ const scientificMetadata = (values) => {
});
});

it("0033: should fail fetching dataset with incorrect proposalId and size", async () => {
it("0033: should fail fetching dataset with incorrect proposalIds and size", async () => {
return request(appUrl)
.post("/api/v3/elastic-search/search")
.send({
proposalId: "wrongProposalId",
proposalIds: ["wrongProposalId"],
size: faker.number.int({ min: 100000001, max: 100400000 }),
})
.set("Accept", "application/json")
Expand Down

0 comments on commit 5399365

Please sign in to comment.