From 3423f31615672c85dea3f4332799b02275f18914 Mon Sep 17 00:00:00 2001 From: Jeff Daley Date: Fri, 27 Oct 2023 09:39:22 -0400 Subject: [PATCH] Add `JiraObject` type (#386) * Update project.d.ts * Update property name * Fix failing tests * Change JiraObject `type` definition --- web/app/components/project/tile.hbs | 8 +++---- web/app/components/project/tile.ts | 2 +- web/app/types/project.d.ts | 24 ++++++++++--------- .../acceptance/authenticated/projects-test.ts | 8 +++---- .../components/project/tile-test.ts | 8 +++---- 5 files changed, 24 insertions(+), 26 deletions(-) diff --git a/web/app/components/project/tile.hbs b/web/app/components/project/tile.hbs index 464f441fd..db091684b 100644 --- a/web/app/components/project/tile.hbs +++ b/web/app/components/project/tile.hbs @@ -35,11 +35,9 @@ {{/if}} {{#if this.jiraObject}}
- {{#if @project.jiraObject.type}} - - {{@project.jiraObject.type}} - - {{/if}} + + {{@project.jiraObject.type}} + { + if (project.hermesDocuments) { + project.hermesDocuments.forEach((doc) => { if (doc.product) { expectedProducts.push(doc.product); } diff --git a/web/tests/integration/components/project/tile-test.ts b/web/tests/integration/components/project/tile-test.ts index 0d5249aac..eec331484 100644 --- a/web/tests/integration/components/project/tile-test.ts +++ b/web/tests/integration/components/project/tile-test.ts @@ -26,7 +26,7 @@ module("Integration | Component | project/tile", function (hooks) { this.project = this.server.create("project", { title: "Test Title", description: "Test Description", - documents: [ + hermesDocuments: [ { product: "Foo", }, @@ -46,8 +46,8 @@ module("Integration | Component | project/tile", function (hooks) { `); - const { title, description, documents, jiraObject } = this.project; - const documentProducts = documents + const { title, description, hermesDocuments, jiraObject } = this.project; + const documentProducts = hermesDocuments ?.map((doc) => doc.product as string) .uniq(); @@ -77,7 +77,7 @@ module("Integration | Component | project/tile", function (hooks) { project.update({ description: null, - documents: null, + hermesDocuments: null, jiraObject: null, });