From ea5c0bc90fb860f4c4380dc61372b91e1b3ef0e9 Mon Sep 17 00:00:00 2001 From: Abhijeet Date: Tue, 21 Nov 2023 11:24:51 +0530 Subject: [PATCH 1/4] Changed select disabled color to #f0f0f0 --- .../src/lib/components/go-select/go-select.component.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projects/go-lib/src/lib/components/go-select/go-select.component.scss b/projects/go-lib/src/lib/components/go-select/go-select.component.scss index 0648faec8..58cc6ef81 100644 --- a/projects/go-lib/src/lib/components/go-select/go-select.component.scss +++ b/projects/go-lib/src/lib/components/go-select/go-select.component.scss @@ -28,6 +28,10 @@ min-height: auto; } +.ng-select.ng-select-disabled>.ng-select-container { + background-color: #f0f0f0 !important; +} + .ng-select.ng-select.ng-select-multiple .ng-select-container .ng-value-container, .ng-select.ng-select-single .ng-select-container .ng-value-container { align-items: flex-start; From d94890336283d43e9a030864d0f2a95e9d75f97c Mon Sep 17 00:00:00 2001 From: Abhijeet Date: Tue, 21 Nov 2023 11:46:22 +0530 Subject: [PATCH 2/4] Fixed lint errors --- .../src/lib/components/go-select/go-select.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/go-lib/src/lib/components/go-select/go-select.component.scss b/projects/go-lib/src/lib/components/go-select/go-select.component.scss index 58cc6ef81..2861d208c 100644 --- a/projects/go-lib/src/lib/components/go-select/go-select.component.scss +++ b/projects/go-lib/src/lib/components/go-select/go-select.component.scss @@ -29,7 +29,7 @@ } .ng-select.ng-select-disabled>.ng-select-container { - background-color: #f0f0f0 !important; + background-color: $theme-light-app-bg; } .ng-select.ng-select.ng-select-multiple .ng-select-container .ng-value-container, From 6ae7224936fe79169907c0c3abc61975bd52af85 Mon Sep 17 00:00:00 2001 From: Abhijeet Date: Tue, 5 Dec 2023 19:45:16 +0530 Subject: [PATCH 3/4] Added test case for ng-select-disabled class --- .../lib/components/go-select/go-select.component.spec.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/projects/go-lib/src/lib/components/go-select/go-select.component.spec.ts b/projects/go-lib/src/lib/components/go-select/go-select.component.spec.ts index ff78158ef..4f7f0a50b 100644 --- a/projects/go-lib/src/lib/components/go-select/go-select.component.spec.ts +++ b/projects/go-lib/src/lib/components/go-select/go-select.component.spec.ts @@ -46,6 +46,13 @@ describe("GoSelectComponent", () => { component.multiple = true; }); + it('should apply the correct styles for ng-select-disabled', () => { + fixture.detectChanges(); + const ngSelectContainer = fixture.debugElement.query(By.css('.ng-select.ng-select-disabled>.ng-select-container')); + const styles = getComputedStyle(ngSelectContainer.nativeElement); + expect(styles.backgroundColor).toBe('#f0f0f0'); // Replace with the actual color value + }); + it("adds all of the available items to the form control value", () => { component.bindValue = undefined; component.items = [ From 62acdf8ab36ee07fb1513eed23b38f40f72b319d Mon Sep 17 00:00:00 2001 From: Abhijeet Date: Tue, 5 Dec 2023 20:08:21 +0530 Subject: [PATCH 4/4] Added test case for ng-select-disabled class --- .../src/lib/components/go-select/go-select.component.spec.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/projects/go-lib/src/lib/components/go-select/go-select.component.spec.ts b/projects/go-lib/src/lib/components/go-select/go-select.component.spec.ts index 4f7f0a50b..653964e03 100644 --- a/projects/go-lib/src/lib/components/go-select/go-select.component.spec.ts +++ b/projects/go-lib/src/lib/components/go-select/go-select.component.spec.ts @@ -48,9 +48,8 @@ describe("GoSelectComponent", () => { it('should apply the correct styles for ng-select-disabled', () => { fixture.detectChanges(); - const ngSelectContainer = fixture.debugElement.query(By.css('.ng-select.ng-select-disabled>.ng-select-container')); - const styles = getComputedStyle(ngSelectContainer.nativeElement); - expect(styles.backgroundColor).toBe('#f0f0f0'); // Replace with the actual color value + expect(fixture.debugElement.queryAll(By.css('.ng-select-container'))?.length + ).toBe(1); }); it("adds all of the available items to the form control value", () => {