Skip to content

Commit

Permalink
test: more tests
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
  • Loading branch information
pylapp committed Nov 28, 2024
1 parent 93a99cf commit 2b220d4
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down Expand Up @@ -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 }
Expand Down Expand Up @@ -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 }
Expand Down
108 changes: 108 additions & 0 deletions OUDS/Core/OUDS/Tests/OUDSTheme/MockThemes/OtherMockTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand All @@ -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 }
Expand Down Expand Up @@ -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 }
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 2b220d4

Please sign in to comment.