From 2b220d4d3e749b39580e8b33f3258d1f40191776 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Lapersonne Date: Thu, 28 Nov 2024 14:56:32 +0100 Subject: [PATCH] test: more tests Signed-off-by: Pierre-Yves Lapersonne --- .../MockTheme+ColorSemanticTokens.swift | 24 +++- .../OUDSTheme/MockThemes/OtherMockTheme.swift | 108 ++++++++++++++++++ ...stThemeOverrideOfColorSemanticTokens.swift | 4 +- 3 files changed, 133 insertions(+), 3 deletions(-) diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+ColorSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+ColorSemanticTokens.swift index 43aeb714a..0f7af8d18 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+ColorSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/MockTheme+ColorSemanticTokens.swift @@ -94,7 +94,7 @@ extension MockTheme { override open var colorContentStatusNegative: MultipleColorSemanticTokens { Self.mockThemeMultipleColorSemanticTokens } - // MARK: Semantic token - Colors - Content - On Action + override open var colorContentBrandPrimaryOnBgEmphasized: MultipleColorSemanticTokens { Self.mockThemeMultipleColorSemanticTokens } override open var colorContentOnActionDisabled: MultipleColorSemanticTokens { Self.mockThemeMultipleColorSemanticTokens } @@ -166,10 +166,18 @@ extension MockTheme { override open var colorBorderFocus: MultipleColorSemanticTokens { Self.mockThemeMultipleColorSemanticTokens } + override open var colorBorderFocusInset: MultipleColorSemanticTokens { Self.mockThemeMultipleColorSemanticTokens } + + override open var colorBorderFocusInsetOnBgEmphasized: MultipleColorSemanticTokens { Self.mockThemeMultipleColorSemanticTokens } + + override open var colorBorderFocusOnBgEmphasized: MultipleColorSemanticTokens { Self.mockThemeMultipleColorSemanticTokens } + override open var colorBorderBrandPrimaryOnBgEmphasized: MultipleColorSemanticTokens { Self.mockThemeMultipleColorSemanticTokens } override open var colorBorderBrandPrimary: MultipleColorSemanticTokens { Self.mockThemeMultipleColorSemanticTokens } + override open var colorBorderOnBrandPrimary: MultipleColorSemanticTokens { Self.mockThemeMultipleColorSemanticTokens } + // MARK: Semantic token - Colors - Action override open var colorActionSelected: MultipleColorSemanticTokens { Self.mockThemeMultipleColorSemanticTokens } @@ -1052,6 +1060,20 @@ extension MockTheme { override open var colorChartSequentialAccent5Tint900Light: ColorSemanticToken { Self.mockThemeSemanticColorTokens } override open var colorChartSequentialAccent5Tint900Dark: ColorSemanticToken { Self.mockThemeSemanticColorTokens } + // MARK: - Semantic token - Colors - Gradient + + override open var colorGradientSkeletonMiddleLight: ColorSemanticToken { Self.mockThemeSemanticColorTokens } + override open var colorGradientSkeletonMiddleDark: ColorSemanticToken { Self.mockThemeSemanticColorTokens } + + override open var colorGradientSkeletonMiddleOnBgEmphasizedLight: ColorSemanticToken { Self.mockThemeSemanticColorTokens } + override open var colorGradientSkeletonMiddleOnBgEmphasizedDark: ColorSemanticToken { Self.mockThemeSemanticColorTokens } + + override open var colorGradientSkeletonStartEndLight: ColorSemanticToken { Self.mockThemeSemanticColorTokens } + override open var colorGradientSkeletonStartEndDark: ColorSemanticToken { Self.mockThemeSemanticColorTokens } + + override open var colorGradientSkeletonStartEndOnBgEmphasizedLight: ColorSemanticToken { Self.mockThemeSemanticColorTokens } + override open var colorGradientSkeletonStartEndOnBgEmphasizedDark: ColorSemanticToken { Self.mockThemeSemanticColorTokens } + // MARK: Semantic token - Colors - Content - On Action override open var colorContentOnActionDisabledLight: ColorSemanticToken { Self.mockThemeSemanticColorTokens } diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/OtherMockTheme.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/OtherMockTheme.swift index 2b6b76a8e..b33ebb1fd 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/OtherMockTheme.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/OtherMockTheme.swift @@ -98,6 +98,68 @@ final class OtherMockTheme: MockTheme, @unchecked Sendable { override var colorContentStatusNegative: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + override var colorContentBrandPrimaryOnBgEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + // MARK: Semantic token - Colors - Content - On Action + + override var colorContentOnActionDisabled: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnActionDisabledOnBgEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnActionNegative: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnActionPrimaryEnabled: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnActionPrimaryEnabledOnBgEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnActionPrimaryFocus: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnActionPrimaryFocusOnBgEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnActionPrimaryHover: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnActionPrimaryHoverOnBgEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnActionPrimaryLoading: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnActionPrimaryLoadingOnBgEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnActionPrimaryPressed: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnActionPrimaryPressedOnBgEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnBrandPrimary: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnStatusAccentEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnStatusAccentMuted: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnStatusAccentMutedOnBgEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnStatusInfoEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnStatusInfoMuted: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnStatusInfoMutedOnBgEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnStatusNegativeEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnStatusNegativeMuted: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnStatusNegativeMutedOnBgEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnStatusPositiveEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnStatusPositiveMuted: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnStatusPositiveMutedOnBgEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnStatusWarningEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnStatusWarningMuted: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorContentOnStatusWarningMutedOnBgEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + // MARK: Semantic token - Colors - Border override var colorBorderDefault: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } @@ -110,10 +172,18 @@ final class OtherMockTheme: MockTheme, @unchecked Sendable { override var colorBorderFocus: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + override var colorBorderFocusInset: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorBorderFocusInsetOnBgEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorBorderFocusOnBgEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + override var colorBorderBrandPrimaryOnBgEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } override var colorBorderBrandPrimary: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + override var colorBorderOnBrandPrimary: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + // MARK: Semantic token - Colors - Action override var colorActionSelected: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } @@ -192,6 +262,20 @@ final class OtherMockTheme: MockTheme, @unchecked Sendable { override var colorAlwaysAccent: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + override var colorAlwaysOnAccent: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorAlwaysOnBlack: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorAlwaysOnInfo: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorAlwaysOnNegative: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorAlwaysOnPositive: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorAlwaysOnWarning: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorAlwaysOnWhite: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + // MARK: Semantic token - Colors - Transparent override var colorTransparentDefault: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } @@ -400,6 +484,16 @@ final class OtherMockTheme: MockTheme, @unchecked Sendable { override var colorChartSequentialAccent5Tint900: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + // MARK: - Semantic token - Colors - Gradient + + override var colorGradientSkeletonMiddle: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorGradientSkeletonMiddleOnBgEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorGradientSkeletonStartEnd: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + + override var colorGradientSkeletonStartEndOnBgEmphasized: MultipleColorSemanticTokens { Self.otherMockThemeMultipleColorSemanticTokens } + // MARK: - Color Tokens overridings // MARK: Semantic token - Colors - Background @@ -972,6 +1066,20 @@ final class OtherMockTheme: MockTheme, @unchecked Sendable { override var colorChartSequentialAccent5Tint900Light: ColorSemanticToken { Self.otherMockThemeSemanticColorToken } override var colorChartSequentialAccent5Tint900Dark: ColorSemanticToken { Self.otherMockThemeSemanticColorToken } + // MARK: - Semantic token - Colors - Gradient + + override var colorGradientSkeletonMiddleLight: ColorSemanticToken { Self.otherMockThemeSemanticColorToken } + override var colorGradientSkeletonMiddleDark: ColorSemanticToken { Self.otherMockThemeSemanticColorToken } + + override var colorGradientSkeletonMiddleOnBgEmphasizedLight: ColorSemanticToken { Self.otherMockThemeSemanticColorToken } + override var colorGradientSkeletonMiddleOnBgEmphasizedDark: ColorSemanticToken { Self.otherMockThemeSemanticColorToken } + + override var colorGradientSkeletonStartEndLight: ColorSemanticToken { Self.otherMockThemeSemanticColorToken } + override var colorGradientSkeletonStartEndDark: ColorSemanticToken { Self.otherMockThemeSemanticColorToken } + + override var colorGradientSkeletonStartEndOnBgEmphasizedLight: ColorSemanticToken { Self.otherMockThemeSemanticColorToken } + override var colorGradientSkeletonStartEndOnBgEmphasizedDark: ColorSemanticToken { Self.otherMockThemeSemanticColorToken } + // MARK: Semantic token - Colors - Content - On Action override var colorContentOnActionDisabledLight: ColorSemanticToken { Self.otherMockThemeSemanticColorToken } diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfColorSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfColorSemanticTokens.swift index 5f4bbb0a1..4b3ca7069 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfColorSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfColorSemanticTokens.swift @@ -2219,12 +2219,12 @@ final class TestThemeOverrideOfColorSemanticTokens: XCTestCase { } func testInheritedThemeCanOverrideSemanticTokenColorColorGradientSkeletonStartEndOnBgEmphasizedLight() throws { - XCTAssertNotEqual(inheritedTheme.colorGradientSkeletonStartEndOnBgEmphasizedLight, inheritedTheme.colorGradientSkeletonStartEndOnBgEmphasizedLight) + XCTAssertNotEqual(inheritedTheme.colorGradientSkeletonStartEndOnBgEmphasizedLight, abstractTheme.colorGradientSkeletonStartEndOnBgEmphasizedLight) XCTAssertTrue(inheritedTheme.colorGradientSkeletonStartEndOnBgEmphasizedLight == OtherMockTheme.otherMockThemeSemanticColorToken) } func testInheritedThemeCanOverrideSemanticTokenColorColorGradientSkeletonStartEndOnBgEmphasizedDark() throws { - XCTAssertNotEqual(inheritedTheme.colorGradientSkeletonStartEndOnBgEmphasizedDark, inheritedTheme.colorGradientSkeletonStartEndOnBgEmphasizedDark) + XCTAssertNotEqual(inheritedTheme.colorGradientSkeletonStartEndOnBgEmphasizedDark, abstractTheme.colorGradientSkeletonStartEndOnBgEmphasizedDark) XCTAssertTrue(inheritedTheme.colorGradientSkeletonStartEndOnBgEmphasizedDark == OtherMockTheme.otherMockThemeSemanticColorToken) } }