From cc6b547433fab892f8209ac554ac2695b139c27d Mon Sep 17 00:00:00 2001 From: Silas Okpugie Date: Tue, 25 Apr 2023 16:11:59 +0100 Subject: [PATCH 1/4] Tests for Common --- Common/Tests/Types/BrandColors.test.ts | 103 +++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 Common/Tests/Types/BrandColors.test.ts diff --git a/Common/Tests/Types/BrandColors.test.ts b/Common/Tests/Types/BrandColors.test.ts new file mode 100644 index 0000000000..d5ac66492d --- /dev/null +++ b/Common/Tests/Types/BrandColors.test.ts @@ -0,0 +1,103 @@ +import { Black, White, slate, Purple, Pink, Red, Orange, + Yellow, Green, Teal, Cyan, VeryLightGrey, Grey, LightGrey, + Moroon, Blue } from '../../Types/BrandColors'; +import Color from '../../Types/Color'; + +describe('Color', () => { + describe('Black', () => { + it('should be an instance with the hex code of Black', () => { + const color: Color = Black; + expect(Black).toBe(color) + }); + }); + describe('White', () => { + it('should be an instance with the hex code of White', () => { + const color: Color = White; + expect(White).toBe(color) + }); + }); + describe('slate', () => { + it('should be an instance with the hex code of slate', () => { + const color: Color = slate; + expect(slate).toBe(color) + }); + }); + describe('Purple', () => { + it('should be an instance with the hex code of Purple', () => { + const color: Color = Purple; + expect(Purple).toBe(color) + }); + }); + describe('Pink', () => { + it('should be an instance with the hex code of Pink', () => { + const color: Color = Pink; + expect(Pink).toBe(color) + }); + }); + describe('Red', () => { + it('should be an instance with the hex code of Red', () => { + const color: Color = Red; + expect(Red).toBe(color) + }); + }); + describe('Orange', () => { + it('should be an instance with the hex code of Orange', () => { + const color: Color = Orange; + expect(Orange).toBe(color) + }); + }); + describe('Yellow', () => { + it('should be an instance with the hex code of Yellow', () => { + const color: Color = Yellow; + expect(Yellow).toBe(color) + }); + }); + describe('Green', () => { + it('should be an instance with the hex code of Green', () => { + const color: Color = Green; + expect(Green).toBe(color) + }); + }); + describe('Teal', () => { + it('should be an instance with the hex code of Teal', () => { + const color: Color = Teal; + expect(Teal).toBe(color) + }); + }); + describe('Cyan', () => { + it('should be an instance with the hex code of Cyan', () => { + const color: Color = Cyan; + expect(Cyan).toBe(color) + }); + }); + describe('VeryLightGrey', () => { + it('should be an instance with the hex code of VeryLightGrey', () => { + const color: Color = VeryLightGrey; + expect(VeryLightGrey).toBe(color) + }); + }); + describe('Grey', () => { + it('should be an instance with the hex code of Grey', () => { + const color: Color = Grey; + expect(Grey).toBe(color) + }); + }); + describe('LightGrey', () => { + it('should be an instance with the hex code of LightGrey', () => { + const color: Color = LightGrey; + expect(LightGrey).toBe(color) + }); + }); + describe('Moroon', () => { + it('should be an instance with the hex code of Moroon', () => { + const color: Color = Moroon; + expect(Moroon).toBe(color) + }); + }); + describe('Blue', () => { + it('should be an instance with the hex code of Blue', () => { + const color: Color = Blue; + expect(Blue).toBe(color) + }); + }); +}) \ No newline at end of file From 81c0a8c3aee5f4b10d6fde699e4a614f8929a29d Mon Sep 17 00:00:00 2001 From: Silas Okpugie Date: Tue, 25 Apr 2023 17:22:52 +0100 Subject: [PATCH 2/4] fixed lint errors --- Common/Tests/Types/BrandColors.test.ts | 183 +++++++++++++------------ 1 file changed, 99 insertions(+), 84 deletions(-) diff --git a/Common/Tests/Types/BrandColors.test.ts b/Common/Tests/Types/BrandColors.test.ts index d5ac66492d..4fcf62db69 100644 --- a/Common/Tests/Types/BrandColors.test.ts +++ b/Common/Tests/Types/BrandColors.test.ts @@ -1,103 +1,118 @@ -import { Black, White, slate, Purple, Pink, Red, Orange, - Yellow, Green, Teal, Cyan, VeryLightGrey, Grey, LightGrey, - Moroon, Blue } from '../../Types/BrandColors'; import Color from '../../Types/Color'; +import { + Black, + White, + slate, + Purple, + Pink, + Red, + Orange, + Yellow, + Green, + Teal, + Cyan, + VeryLightGrey, + Grey, + LightGrey, + Moroon, + Blue, +} from '../../Types/BrandColors'; describe('Color', () => { - describe('Black', () => { - it('should be an instance with the hex code of Black', () => { - const color: Color = Black; - expect(Black).toBe(color) + describe('Black', () => { + it('should be an instance with the hex code of Black', () => { + const color: Color = Black; + expect(Black).toBe(color); + }); }); - }); - describe('White', () => { - it('should be an instance with the hex code of White', () => { - const color: Color = White; - expect(White).toBe(color) + describe('White', () => { + it('should be an instance with the hex code of White', () => { + const color: Color = White; + expect(White).toBe(color); + }); }); - }); - describe('slate', () => { - it('should be an instance with the hex code of slate', () => { - const color: Color = slate; - expect(slate).toBe(color) + describe('slate', () => { + it('should be an instance with the hex code of slate', () => { + const color: Color = slate; + expect(slate).toBe(color); + }); }); - }); - describe('Purple', () => { - it('should be an instance with the hex code of Purple', () => { - const color: Color = Purple; - expect(Purple).toBe(color) + describe('Purple', () => { + it('should be an instance with the hex code of Purple', () => { + const color: Color = Purple; + expect(Purple).toBe(color); + }); }); - }); - describe('Pink', () => { - it('should be an instance with the hex code of Pink', () => { - const color: Color = Pink; - expect(Pink).toBe(color) + describe('Pink', () => { + it('should be an instance with the hex code of Pink', () => { + const color: Color = Pink; + expect(Pink).toBe(color); + }); }); - }); - describe('Red', () => { - it('should be an instance with the hex code of Red', () => { - const color: Color = Red; - expect(Red).toBe(color) + describe('Red', () => { + it('should be an instance with the hex code of Red', () => { + const color: Color = Red; + expect(Red).toBe(color); + }); }); - }); - describe('Orange', () => { - it('should be an instance with the hex code of Orange', () => { - const color: Color = Orange; - expect(Orange).toBe(color) + describe('Orange', () => { + it('should be an instance with the hex code of Orange', () => { + const color: Color = Orange; + expect(Orange).toBe(color); + }); }); - }); - describe('Yellow', () => { - it('should be an instance with the hex code of Yellow', () => { - const color: Color = Yellow; - expect(Yellow).toBe(color) + describe('Yellow', () => { + it('should be an instance with the hex code of Yellow', () => { + const color: Color = Yellow; + expect(Yellow).toBe(color); + }); }); - }); - describe('Green', () => { - it('should be an instance with the hex code of Green', () => { - const color: Color = Green; - expect(Green).toBe(color) + describe('Green', () => { + it('should be an instance with the hex code of Green', () => { + const color: Color = Green; + expect(Green).toBe(color); + }); }); - }); - describe('Teal', () => { - it('should be an instance with the hex code of Teal', () => { - const color: Color = Teal; - expect(Teal).toBe(color) + describe('Teal', () => { + it('should be an instance with the hex code of Teal', () => { + const color: Color = Teal; + expect(Teal).toBe(color); + }); }); - }); - describe('Cyan', () => { - it('should be an instance with the hex code of Cyan', () => { - const color: Color = Cyan; - expect(Cyan).toBe(color) + describe('Cyan', () => { + it('should be an instance with the hex code of Cyan', () => { + const color: Color = Cyan; + expect(Cyan).toBe(color); + }); }); - }); - describe('VeryLightGrey', () => { - it('should be an instance with the hex code of VeryLightGrey', () => { - const color: Color = VeryLightGrey; - expect(VeryLightGrey).toBe(color) + describe('VeryLightGrey', () => { + it('should be an instance with the hex code of VeryLightGrey', () => { + const color: Color = VeryLightGrey; + expect(VeryLightGrey).toBe(color); + }); }); - }); - describe('Grey', () => { - it('should be an instance with the hex code of Grey', () => { - const color: Color = Grey; - expect(Grey).toBe(color) + describe('Grey', () => { + it('should be an instance with the hex code of Grey', () => { + const color: Color = Grey; + expect(Grey).toBe(color); + }); }); - }); - describe('LightGrey', () => { - it('should be an instance with the hex code of LightGrey', () => { - const color: Color = LightGrey; - expect(LightGrey).toBe(color) + describe('LightGrey', () => { + it('should be an instance with the hex code of LightGrey', () => { + const color: Color = LightGrey; + expect(LightGrey).toBe(color); + }); }); - }); - describe('Moroon', () => { - it('should be an instance with the hex code of Moroon', () => { - const color: Color = Moroon; - expect(Moroon).toBe(color) + describe('Moroon', () => { + it('should be an instance with the hex code of Moroon', () => { + const color: Color = Moroon; + expect(Moroon).toBe(color); + }); }); - }); - describe('Blue', () => { - it('should be an instance with the hex code of Blue', () => { - const color: Color = Blue; - expect(Blue).toBe(color) + describe('Blue', () => { + it('should be an instance with the hex code of Blue', () => { + const color: Color = Blue; + expect(Blue).toBe(color); + }); }); - }); -}) \ No newline at end of file +}); From e1b7e7884caeccc3a989ce9b4d7ea8a054d6b71e Mon Sep 17 00:00:00 2001 From: Silas Okpugie Date: Wed, 26 Apr 2023 10:48:51 +0100 Subject: [PATCH 3/4] verified color hex --- Common/Tests/Types/BrandColors.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Common/Tests/Types/BrandColors.test.ts b/Common/Tests/Types/BrandColors.test.ts index 4fcf62db69..b1353d14ad 100644 --- a/Common/Tests/Types/BrandColors.test.ts +++ b/Common/Tests/Types/BrandColors.test.ts @@ -19,6 +19,12 @@ import { } from '../../Types/BrandColors'; describe('Color', () => { + describe('Verify color hex', () => { + it('should create a new instance with the given hex code', () => { + const color: Color = new Color('#123456'); + expect(color).toBe(color); + }); + }); describe('Black', () => { it('should be an instance with the hex code of Black', () => { const color: Color = Black; From a657f3d926a9e36afe8374b872b4a14f24fe82fc Mon Sep 17 00:00:00 2001 From: Silas Okpugie Date: Wed, 26 Apr 2023 12:41:27 +0100 Subject: [PATCH 4/4] verified all hex colors --- Common/Tests/Types/BrandColors.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Common/Tests/Types/BrandColors.test.ts b/Common/Tests/Types/BrandColors.test.ts index b1353d14ad..35f111a44d 100644 --- a/Common/Tests/Types/BrandColors.test.ts +++ b/Common/Tests/Types/BrandColors.test.ts @@ -29,96 +29,112 @@ describe('Color', () => { it('should be an instance with the hex code of Black', () => { const color: Color = Black; expect(Black).toBe(color); + expect(Black.color).toBe('#000000'); }); }); describe('White', () => { it('should be an instance with the hex code of White', () => { const color: Color = White; expect(White).toBe(color); + expect(White.color).toBe('#ffffff'); }); }); describe('slate', () => { it('should be an instance with the hex code of slate', () => { const color: Color = slate; expect(slate).toBe(color); + expect(slate.color).toBe('#564ab1'); }); }); describe('Purple', () => { it('should be an instance with the hex code of Purple', () => { const color: Color = Purple; expect(Purple).toBe(color); + expect(Purple.color).toBe('#6f42c1'); }); }); describe('Pink', () => { it('should be an instance with the hex code of Pink', () => { const color: Color = Pink; expect(Pink).toBe(color); + expect(Pink.color).toBe('#e83e8c'); }); }); describe('Red', () => { it('should be an instance with the hex code of Red', () => { const color: Color = Red; expect(Red).toBe(color); + expect(Red.color).toBe('#fd625e'); }); }); describe('Orange', () => { it('should be an instance with the hex code of Orange', () => { const color: Color = Orange; expect(Orange).toBe(color); + expect(Orange.color).toBe('#f1734f'); }); }); describe('Yellow', () => { it('should be an instance with the hex code of Yellow', () => { const color: Color = Yellow; expect(Yellow).toBe(color); + expect(Yellow.color).toBe('#ffbf53'); }); }); describe('Green', () => { it('should be an instance with the hex code of Green', () => { const color: Color = Green; expect(Green).toBe(color); + expect(Green.color).toBe('#2ab57d'); }); }); describe('Teal', () => { it('should be an instance with the hex code of Teal', () => { const color: Color = Teal; expect(Teal).toBe(color); + expect(Teal.color).toBe('#050505'); }); }); describe('Cyan', () => { it('should be an instance with the hex code of Cyan', () => { const color: Color = Cyan; expect(Cyan).toBe(color); + expect(Cyan.color).toBe('#4ba6ef'); }); }); describe('VeryLightGrey', () => { it('should be an instance with the hex code of VeryLightGrey', () => { const color: Color = VeryLightGrey; expect(VeryLightGrey).toBe(color); + expect(VeryLightGrey.color).toBe('#c2c2c2'); }); }); describe('Grey', () => { it('should be an instance with the hex code of Grey', () => { const color: Color = Grey; expect(Grey).toBe(color); + expect(Grey.color).toBe('#575757'); }); }); describe('LightGrey', () => { it('should be an instance with the hex code of LightGrey', () => { const color: Color = LightGrey; expect(LightGrey).toBe(color); + expect(LightGrey.color).toBe('#908B8B'); }); }); describe('Moroon', () => { it('should be an instance with the hex code of Moroon', () => { const color: Color = Moroon; expect(Moroon).toBe(color); + expect(Moroon.color).toBe('#b70400'); }); }); describe('Blue', () => { it('should be an instance with the hex code of Blue', () => { const color: Color = Blue; expect(Blue).toBe(color); + expect(Blue.color).toBe('#3686be'); }); }); });