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 ec5e09e commit d265d78
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,16 @@ extension OUDSTheme: ColorMultipleSemanticTokens {
@objc open var colorChartSequentialAccent5Tint800: MultipleColorSemanticTokens { MultipleColorSemanticTokens(light: colorChartSequentialAccent5Tint800Light, dark: colorChartSequentialAccent5Tint800Dark) }

@objc open var colorChartSequentialAccent5Tint900: MultipleColorSemanticTokens { MultipleColorSemanticTokens(light: colorChartSequentialAccent5Tint900Light, dark: colorChartSequentialAccent5Tint900Dark) }

// MARK: - Semantic token - Colors - Gradient

@objc open var colorGradientSkeletonMiddle: MultipleColorSemanticTokens { MultipleColorSemanticTokens(light: colorGradientSkeletonMiddleLight, dark: colorGradientSkeletonMiddleDark) }

@objc open var colorGradientSkeletonMiddleOnBgEmphasized: MultipleColorSemanticTokens { MultipleColorSemanticTokens(light: colorGradientSkeletonMiddleOnBgEmphasizedLight, dark: colorGradientSkeletonMiddleOnBgEmphasizedDark) }

@objc open var colorGradientSkeletonStartEnd: MultipleColorSemanticTokens { MultipleColorSemanticTokens(light: colorGradientSkeletonMiddleOnBgEmphasizedLight, dark: colorGradientSkeletonMiddleOnBgEmphasizedDark) }

@objc open var colorGradientSkeletonStartEndOnBgEmphasized: MultipleColorSemanticTokens { MultipleColorSemanticTokens(light: colorGradientSkeletonStartEndOnBgEmphasizedLight, dark: colorGradientSkeletonStartEndOnBgEmphasizedDark) }
}

// swiftlint:enable line_length
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,16 @@ extension MockTheme {

override open var colorChartSequentialAccent5Tint900: MultipleColorSemanticTokens { Self.mockThemeMultipleColorSemanticTokens }

// MARK: - Semantic token - Colors - Gradient

override open var colorGradientSkeletonMiddle: MultipleColorSemanticTokens { Self.mockThemeMultipleColorSemanticTokens }

override open var colorGradientSkeletonMiddleOnBgEmphasized: MultipleColorSemanticTokens { Self.mockThemeMultipleColorSemanticTokens }

override open var colorGradientSkeletonStartEnd: MultipleColorSemanticTokens { Self.mockThemeMultipleColorSemanticTokens }

override open var colorGradientSkeletonStartEndOnBgEmphasized: MultipleColorSemanticTokens { Self.mockThemeMultipleColorSemanticTokens }

// MARK: - Color Tokens overridings

// MARK: Semantic token - Colors - Background
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1753,6 +1753,28 @@ final class TestThemeOverrideOfColorMultipleSemanticTokens: XCTestCase {
XCTAssertNotEqual(inheritedTheme.colorChartSequentialAccent5Tint900Dark, abstractTheme.colorChartSequentialAccent5Tint900Dark)
XCTAssertTrue(inheritedTheme.colorChartSequentialAccent5Tint900Dark == OtherMockTheme.otherMockThemeSemanticColorToken)
}

// MARK: - Semantic token - Colors - Gradient

func testInheritedThemeCanOverrideSemanticTokenColorColorGradientSkeletonMiddle() throws {
XCTAssertNotEqual(inheritedTheme.colorGradientSkeletonMiddle, abstractTheme.colorGradientSkeletonMiddle)
XCTAssertTrue(inheritedTheme.colorGradientSkeletonMiddle == OtherMockTheme.otherMockThemeMultipleColorSemanticTokens)
}

func testInheritedThemeCanOverrideSemanticTokenColorColorGradientSkeletonMiddleOnBgEmphasized() throws {
XCTAssertNotEqual(inheritedTheme.colorGradientSkeletonMiddleOnBgEmphasized, abstractTheme.colorGradientSkeletonMiddleOnBgEmphasized)
XCTAssertTrue(inheritedTheme.colorGradientSkeletonMiddleOnBgEmphasized == OtherMockTheme.otherMockThemeMultipleColorSemanticTokens)
}

func testInheritedThemeCanOverrideSemanticTokenColorColorGradientSkeletonStartEnd() throws {
XCTAssertNotEqual(inheritedTheme.colorGradientSkeletonStartEnd, abstractTheme.colorGradientSkeletonStartEnd)
XCTAssertTrue(inheritedTheme.colorGradientSkeletonStartEnd == OtherMockTheme.otherMockThemeMultipleColorSemanticTokens)
}

func testInheritedThemeCanOverrideSemanticTokenColorColorGradientSkeletonStartEndOnBgEmphasized() throws {
XCTAssertNotEqual(inheritedTheme.colorGradientSkeletonStartEndOnBgEmphasized, colorGradientSkeletonStartEndOnBgEmphasized.colorGradientSkeletonMiddle)
XCTAssertTrue(inheritedTheme.colorGradientSkeletonStartEndOnBgEmphasized == OtherMockTheme.otherMockThemeMultipleColorSemanticTokens)
}
}

// swiftlint:enable type_body_length
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2186,6 +2186,47 @@ final class TestThemeOverrideOfColorSemanticTokens: XCTestCase {
XCTAssertTrue(inheritedTheme.colorContentOnStatusWarningMutedOnBgEmphasizedDark == OtherMockTheme.otherMockThemeSemanticColorToken)
}

// MARK: - Semantic token - Colors - Gradient

func testInheritedThemeCanOverrideSemanticTokenColorColorGradientSkeletonMiddleLight() throws {
XCTAssertNotEqual(inheritedTheme.colorGradientSkeletonMiddleLight, abstractTheme.colorGradientSkeletonMiddleLight)
XCTAssertTrue(inheritedTheme.colorGradientSkeletonMiddleLight == OtherMockTheme.otherMockThemeSemanticColorToken)
}

func testInheritedThemeCanOverrideSemanticTokenColorColorGradientSkeletonMiddleDark() throws {
XCTAssertNotEqual(inheritedTheme.colorGradientSkeletonMiddleDark, abstractTheme.colorGradientSkeletonMiddleDark)
XCTAssertTrue(inheritedTheme.colorGradientSkeletonMiddleDark == OtherMockTheme.otherMockThemeSemanticColorToken)
}

func testInheritedThemeCanOverrideSemanticTokenColorColorGradientSkeletonMiddleOnBgEmphasizedLight() throws {
XCTAssertNotEqual(inheritedTheme.colorGradientSkeletonMiddleOnBgEmphasizedLight, abstractTheme.colorGradientSkeletonMiddleOnBgEmphasizedLight)
XCTAssertTrue(inheritedTheme.colorGradientSkeletonMiddleOnBgEmphasizedLight == OtherMockTheme.otherMockThemeSemanticColorToken)
}

func testInheritedThemeCanOverrideSemanticTokenColorColorGradientSkeletonMiddleOnBgEmphasizedDark() throws {
XCTAssertNotEqual(inheritedTheme.colorGradientSkeletonMiddleOnBgEmphasizedDark, abstractTheme.colorGradientSkeletonMiddleOnBgEmphasizedDark)
XCTAssertTrue(inheritedTheme.colorGradientSkeletonMiddleOnBgEmphasizedDark == OtherMockTheme.otherMockThemeSemanticColorToken)
}

func testInheritedThemeCanOverrideSemanticTokenColorColorGradientSkeletonStartEndLight() throws {
XCTAssertNotEqual(inheritedTheme.colorGradientSkeletonStartEndLight, abstractTheme.colorGradientSkeletonStartEndLight)
XCTAssertTrue(inheritedTheme.colorGradientSkeletonStartEndLight == OtherMockTheme.otherMockThemeSemanticColorToken)
}

func testInheritedThemeCanOverrideSemanticTokenColorColorGradientSkeletonStartEndDark() throws {
XCTAssertNotEqual(inheritedTheme.colorGradientSkeletonStartEndDark, abstractTheme.colorGradientSkeletonStartEndDark)
XCTAssertTrue(inheritedTheme.colorGradientSkeletonStartEndDark == OtherMockTheme.otherMockThemeSemanticColorToken)
}

func testInheritedThemeCanOverrideSemanticTokenColorColorGradientSkeletonStartEndOnBgEmphasizedLight() throws {
XCTAssertNotEqual(inheritedTheme.colorGradientSkeletonStartEndOnBgEmphasizedLight, inheritedTheme.colorGradientSkeletonStartEndOnBgEmphasizedLight)
XCTAssertTrue(inheritedTheme.colorGradientSkeletonStartEndOnBgEmphasizedLight == OtherMockTheme.otherMockThemeSemanticColorToken)
}

func testInheritedThemeCanOverrideSemanticTokenColorColorGradientSkeletonStartEndOnBgEmphasizedDark() throws {
XCTAssertNotEqual(inheritedTheme.colorGradientSkeletonStartEndOnBgEmphasizedDark, inheritedTheme.colorGradientSkeletonStartEndOnBgEmphasizedDark)
XCTAssertTrue(inheritedTheme.colorGradientSkeletonStartEndOnBgEmphasizedDark == OtherMockTheme.otherMockThemeSemanticColorToken)
}
}

// swiftlint:enable type_body_length
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public protocol ColorMultipleSemanticTokens {

var colorContentOnActionDisabled: MultipleColorSemanticTokens { get }

var colorContentOnActionDisabledOnBgEmphasize: MultipleColorSemanticTokens { get }
var colorContentOnActionDisabledOnBgEmphasized: MultipleColorSemanticTokens { get }

var colorContentOnActionNegative: MultipleColorSemanticTokens { get }

Expand Down
Loading

0 comments on commit d265d78

Please sign in to comment.