From 745b69586493a52ce80ee0fe8a294f70e1c35f57 Mon Sep 17 00:00:00 2001 From: Yasa-Nataliya Date: Thu, 28 Sep 2023 11:19:39 +0530 Subject: [PATCH] [ACS-5540] Implemented the review comments --- .../components/details/details.component.scss | 2 +- .../rules/src/navigation.rules.spec.ts | 18 ++++-------------- .../aca-shared/rules/src/navigation.rules.ts | 2 +- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/projects/aca-content/src/lib/components/details/details.component.scss b/projects/aca-content/src/lib/components/details/details.component.scss index de481d4647..4e76575e86 100644 --- a/projects/aca-content/src/lib/components/details/details.component.scss +++ b/projects/aca-content/src/lib/components/details/details.component.scss @@ -4,7 +4,7 @@ app-details-manager { .aca-close-details-button { margin-right: 15px; - margin-top: 2px; + margin-top: 12px; outline: none; border-radius: 4px; diff --git a/projects/aca-shared/rules/src/navigation.rules.spec.ts b/projects/aca-shared/rules/src/navigation.rules.spec.ts index 44f43e8e7f..9582223e44 100644 --- a/projects/aca-shared/rules/src/navigation.rules.spec.ts +++ b/projects/aca-shared/rules/src/navigation.rules.spec.ts @@ -226,17 +226,7 @@ describe('navigation.evaluators', () => { }); describe('isDetails', () => { - it('should return true if url ends with `/details`', () => { - const context: any = { - navigation: { - url: '/path/details' - } - }; - - expect(app.isDetails(context)).toBe(true); - }); - - it('should return true if url starts with `/details`', () => { + it('should return true if url includes with `/details`', () => { const context: any = { navigation: { url: '/details/path' @@ -246,14 +236,14 @@ describe('navigation.evaluators', () => { expect(app.isDetails(context)).toBe(true); }); - it('should return true if url includes with `/details`', () => { + it('should return false if url not includes with `/details`', () => { const context: any = { navigation: { - url: '/details/path' + url: '/path' } }; - expect(app.isDetails(context)).toBe(true); + expect(app.isDetails(context)).toBe(false); }); }); diff --git a/projects/aca-shared/rules/src/navigation.rules.ts b/projects/aca-shared/rules/src/navigation.rules.ts index 5a3c5569cf..a26d8a2366 100644 --- a/projects/aca-shared/rules/src/navigation.rules.ts +++ b/projects/aca-shared/rules/src/navigation.rules.ts @@ -112,7 +112,7 @@ export function isLibraryContent(context: RuleContext): boolean { export function isDetails(context: RuleContext): boolean { const { url } = context.navigation; - return url && (url.endsWith('/details') || url.includes('/details/') || url.startsWith('/details')); + return url?.includes('/details'); } /**