Skip to content

Commit

Permalink
chore: 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 b191781 commit ec5e09e
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,22 +177,18 @@ extension OUDSTheme: ColorMultipleSemanticTokens {
@objc open var colorBorderEmphasizedOnBgEmphasized: MultipleColorSemanticTokens { MultipleColorSemanticTokens(light: colorBorderEmphasizedOnBgEmphasizedLight, dark: colorBorderEmphasizedOnBgEmphasizedDark) }

@objc open var colorBorderFocus: MultipleColorSemanticTokens { MultipleColorSemanticTokens(light: colorBorderFocusLight, dark: colorBorderFocusDark) }

@objc open var colorBorderFocusInset: MultipleColorSemanticTokens { MultipleColorSemanticTokens(light: colorBorderFocusInsetLight, dark: colorBorderFocusInsetDark) }

// WARNING: #124 - Colors to use are part of Orange Theme so are not reachable at this level, as a workaround add raw values
@objc open var colorBorderBrandPrimaryOnBgEmphasized: MultipleColorSemanticTokens { fatalError("🤖 Raw token unavailable for colorBorderBrandPrimaryOnBgEmphasized!") }

// WARNING: #124 - Colors to use sont part of Orange Theme so sont not reachable at this level, as un workaround add raw values
@objc open var colorBorderBrandPrimary: MultipleColorSemanticTokens { fatalError("🤖 Raw token unavailable for colorBorderBrandPrimary!") }

@objc open var colorBorderStatusPositive: MultipleColorSemanticTokens { fatalError("🤖 No value defined for colorBorderStatusPositive!") }
@objc open var colorBorderFocusInsetOnBgEmphasized: MultipleColorSemanticTokens { MultipleColorSemanticTokens(light: colorBorderFocusInsetOnBgEmphasizedLight, dark: colorBorderFocusInsetOnBgEmphasizedDark) }

@objc open var colorBorderStatusInfo: MultipleColorSemanticTokens { fatalError("🤖 No value defined for colorBorderStatusInfo!") }
@objc open var colorBorderFocusOnBgEmphasized: MultipleColorSemanticTokens { MultipleColorSemanticTokens(light: colorBorderFocusOnBgEmphasizedLight, dark: colorBorderFocusOnBgEmphasizedDark) }

@objc open var colorBorderStatusWarning: MultipleColorSemanticTokens { fatalError("🤖 No value defined for colorBorderStatusWarning!") }
@objc open var colorBorderBrandPrimaryOnBgEmphasized: MultipleColorSemanticTokens { MultipleColorSemanticTokens(light: colorBorderBrandPrimaryOnBgEmphasizedLight, dark: colorBorderBrandPrimaryOnBgEmphasizedDark) }

@objc open var colorBorderStatusNegative: MultipleColorSemanticTokens { fatalError("🤖 No value defined for colorBorderStatusNegative!") }
@objc open var colorBorderBrandPrimary: MultipleColorSemanticTokens { MultipleColorSemanticTokens(light: colorBorderBrandPrimaryLight, dark: colorBorderBrandPrimaryDark) }

@objc open var colorBorderStatusAccent: MultipleColorSemanticTokens { fatalError("🤖 No value defined for colorBorderStatusAccent!") }
@objc open var colorBorderOnBrandPrimary: MultipleColorSemanticTokens { MultipleColorSemanticTokens(light: colorBorderOnBrandPrimaryLight, dark: colorBorderOnBrandPrimaryDark) }

// MARK: Semantic token - Colors - Action

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,36 @@ final class TestThemeOverrideOfColorMultipleSemanticTokens: XCTestCase {
XCTAssertNotEqual(inheritedTheme.colorBorderFocus, abstractTheme.colorBorderFocus)
XCTAssertTrue(inheritedTheme.colorBorderFocus == OtherMockTheme.otherMockThemeMultipleColorSemanticTokens)
}

func testInheritedThemeCanOverrideSemanticTokenColorBorderFocusInset() throws {
XCTAssertNotEqual(inheritedTheme.colorBorderFocusInset, abstractTheme.colorBorderFocusInset)
XCTAssertTrue(inheritedTheme.colorBorderFocusInset == OtherMockTheme.otherMockThemeMultipleColorSemanticTokens)
}

func testInheritedThemeCanOverrideSemanticTokenColorBorderFocusInsetOnBgEmphasized() throws {
XCTAssertNotEqual(inheritedTheme.colorBorderFocusInsetOnBgEmphasized, abstractTheme.colorBorderFocusInsetOnBgEmphasized)
XCTAssertTrue(inheritedTheme.colorBorderFocusInsetOnBgEmphasized == OtherMockTheme.otherMockThemeMultipleColorSemanticTokens)
}

func testInheritedThemeCanOverrideSemanticTokenColorBorderFocusOnBgEmphasized() throws {
XCTAssertNotEqual(inheritedTheme.colorBorderFocusOnBgEmphasized, abstractTheme.colorBorderFocusOnBgEmphasized)
XCTAssertTrue(inheritedTheme.colorBorderFocusOnBgEmphasized == OtherMockTheme.otherMockThemeMultipleColorSemanticTokens)
}

func testInheritedThemeCanOverrideSemanticTokenColorBorderBrandPrimaryOnBgEmphasized() throws {
XCTAssertNotEqual(inheritedTheme.colorBorderBrandPrimaryOnBgEmphasized, abstractTheme.colorBorderBrandPrimaryOnBgEmphasized)
XCTAssertTrue(inheritedTheme.colorBorderBrandPrimaryOnBgEmphasized == OtherMockTheme.otherMockThemeMultipleColorSemanticTokens)
}

func testInheritedThemeCanOverrideSemanticTokenColorBorderBrandPrimary() throws {
XCTAssertNotEqual(inheritedTheme.colorBorderBrandPrimary, abstractTheme.colorBorderBrandPrimary)
XCTAssertTrue(inheritedTheme.colorBorderBrandPrimary == OtherMockTheme.otherMockThemeMultipleColorSemanticTokens)
}

func testInheritedThemeCanOverrideSemanticTokenColorBorderOnBrandPrimary() throws {
XCTAssertNotEqual(inheritedTheme.colorBorderOnBrandPrimary, abstractTheme.colorBorderOnBrandPrimary)
XCTAssertTrue(inheritedTheme.colorBorderOnBrandPrimary == OtherMockTheme.otherMockThemeMultipleColorSemanticTokens)
}

func testInheritedThemeCanOverrideSemanticTokenColorBorderBrandPrimaryOnBgEmphasized() throws {
XCTAssertNotEqual(inheritedTheme.colorBorderBrandPrimaryOnBgEmphasized, abstractTheme.colorBorderBrandPrimaryOnBgEmphasized)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,36 @@ final class TestThemeOverrideOfColorSemanticTokens: XCTestCase {
XCTAssertTrue(inheritedTheme.colorBorderFocusDark == OtherMockTheme.otherMockThemeSemanticColorToken)
}

// WARNING: #124 - Colors to use sont part of Orange Theme so sont not reachable at this level, as un workaround add raw values
func testInheritedThemeCanOverrideSemanticTokenColorBorderFocusInsetLight() throws {
XCTAssertNotEqual(inheritedTheme.colorBorderFocusInsetLight, abstractTheme.colorBorderFocusInsetLight)
XCTAssertTrue(inheritedTheme.colorBorderFocusInsetLight == OtherMockTheme.otherMockThemeSemanticColorToken)
}

func testInheritedThemeCanOverrideSemanticTokenColorBorderFocusInsetDark() throws {
XCTAssertNotEqual(inheritedTheme.colorBorderFocusInsetDark, abstractTheme.colorBorderFocusInsetDark)
XCTAssertTrue(inheritedTheme.colorBorderFocusInsetDark == OtherMockTheme.otherMockThemeSemanticColorToken)
}

func testInheritedThemeCanOverrideSemanticTokenColorBorderFocusInsetOnBgEmphasizedLight() throws {
XCTAssertNotEqual(inheritedTheme.colorBorderFocusInsetOnBgEmphasizedLight, abstractTheme.colorBorderFocusInsetOnBgEmphasizedLight)
XCTAssertTrue(inheritedTheme.colorBorderFocusInsetOnBgEmphasizedLight == OtherMockTheme.otherMockThemeSemanticColorToken)
}

func testInheritedThemeCanOverrideSemanticTokenColorBorderFocusInsetOnBgEmphasizedDark() throws {
XCTAssertNotEqual(inheritedTheme.colorBorderFocusInsetOnBgEmphasizedDark, abstractTheme.colorBorderFocusInsetOnBgEmphasizedDark)
XCTAssertTrue(inheritedTheme.colorBorderFocusInsetOnBgEmphasizedDark == OtherMockTheme.otherMockThemeSemanticColorToken)
}

func testInheritedThemeCanOverrideSemanticTokenColorBorderFocusOnBgEmphasizedLight() throws {
XCTAssertNotEqual(inheritedTheme.colorBorderFocusOnBgEmphasizedLight, abstractTheme.colorBorderFocusOnBgEmphasizedLight)
XCTAssertTrue(inheritedTheme.colorBorderFocusOnBgEmphasizedLight == OtherMockTheme.otherMockThemeSemanticColorToken)
}

func testInheritedThemeCanOverrideSemanticTokenColorBorderFocusOnBgEmphasizedDark() throws {
XCTAssertNotEqual(inheritedTheme.colorBorderFocusOnBgEmphasizedDark, abstractTheme.colorBorderFocusOnBgEmphasizedDark)
XCTAssertTrue(inheritedTheme.colorBorderFocusOnBgEmphasizedDark == OtherMockTheme.otherMockThemeSemanticColorToken)
}

func testInheritedThemeCanOverrideSemanticTokenColorBorderBrandPrimaryOnBgEmphasizedLight() throws {
XCTAssertNotEqual(inheritedTheme.colorBorderBrandPrimaryOnBgEmphasizedLight, abstractTheme.colorBorderBrandPrimaryOnBgEmphasizedLight)
XCTAssertTrue(inheritedTheme.colorBorderBrandPrimaryOnBgEmphasizedLight == OtherMockTheme.otherMockThemeSemanticColorToken)
Expand All @@ -443,7 +472,6 @@ final class TestThemeOverrideOfColorSemanticTokens: XCTestCase {
XCTAssertTrue(inheritedTheme.colorBorderBrandPrimaryOnBgEmphasizedDark == OtherMockTheme.otherMockThemeSemanticColorToken)
}

// WARNING: #124 - Colors to use sont part of Orange Theme so sont not reachable at this level, as un workaround add raw values
func testInheritedThemeCanOverrideSemanticTokenColorBorderBrandPrimaryLight() throws {
XCTAssertNotEqual(inheritedTheme.colorBorderBrandPrimaryLight, abstractTheme.colorBorderBrandPrimaryLight)
XCTAssertTrue(inheritedTheme.colorBorderBrandPrimaryLight == OtherMockTheme.otherMockThemeSemanticColorToken)
Expand All @@ -454,6 +482,16 @@ final class TestThemeOverrideOfColorSemanticTokens: XCTestCase {
XCTAssertTrue(inheritedTheme.colorBorderBrandPrimaryDark == OtherMockTheme.otherMockThemeSemanticColorToken)
}

func testInheritedThemeCanOverrideSemanticTokenColorBorderOnBrandPrimaryLight() throws {
XCTAssertNotEqual(inheritedTheme.colorBorderOnBrandPrimaryLight, abstractTheme.colorBorderOnBrandPrimaryLight)
XCTAssertTrue(inheritedTheme.colorBorderOnBrandPrimaryLight == OtherMockTheme.otherMockThemeSemanticColorToken)
}

func testInheritedThemeCanOverrideSemanticTokenColorBorderOnBrandPrimaryDark() throws {
XCTAssertNotEqual(inheritedTheme.colorBorderOnBrandPrimaryDark, abstractTheme.colorBorderOnBrandPrimaryDark)
XCTAssertTrue(inheritedTheme.colorBorderOnBrandPrimaryDark == OtherMockTheme.otherMockThemeSemanticColorToken)
}

// MARK: Semantic token - Colors - Action

func testInheritedThemeCanOverrideSemanticTokenColorActionSelectedLight() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,17 @@ public protocol ColorMultipleSemanticTokens {

var colorBorderFocus: MultipleColorSemanticTokens { get }

var colorBorderFocusInset: MultipleColorSemanticTokens { get } // @@@ TODO: Add in tests, demo app, color light/Dark, mock, etc
var colorBorderFocusInset: MultipleColorSemanticTokens { get }

var colorBorderFocusInsetOnBgEmphasized: MultipleColorSemanticTokens { get } // @@@ TODO: Add in tests, demo app, color light/Dark, mock, etc
var colorBorderFocusInsetOnBgEmphasized: MultipleColorSemanticTokens { get }

var colorBorderFocusOnBgEmphasized: MultipleColorSemanticTokens { get } // @@@ TODO: Add in tests, demo app, color light/Dark, mock, etc
var colorBorderFocusOnBgEmphasized: MultipleColorSemanticTokens { get }

var colorBorderBrandPrimaryOnBgEmphasized: MultipleColorSemanticTokens { get }

var colorBorderBrandPrimary: MultipleColorSemanticTokens { get }

var colorBorderOnBrandPrimary: MultipleColorSemanticTokens { get } // @@@ TODO: Add in tests, demo app, color light/Dark, mock, etc
var colorBorderOnBrandPrimary: MultipleColorSemanticTokens { get }

// MARK: Semantic token - Colors - Action

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,25 @@ public protocol ColorSemanticTokens {

var colorBorderDefaultLight: ColorSemanticToken { get }

var colorBorderDefaultOnBgEmphasizedLight: ColorSemanticToken { get }
var colorBorderDefaultOnBgEmphasizeLight: ColorSemanticToken { get }

var colorBorderEmphasizedLight: ColorSemanticToken { get }

var colorBorderEmphasizedOnBgEmphasizedLight: ColorSemanticToken { get }

var colorBorderFocusLight: ColorSemanticToken { get }

var colorBorderFocusLight: MultipleColorSemanticTokens { get }

var colorBorderFocusInsetLight: MultipleColorSemanticTokens { get }

var colorBorderFocusInsetOnBgEmphasizedLight: MultipleColorSemanticTokens { get }

var colorBorderFocusOnBgEmphasizedLight: MultipleColorSemanticTokens { get }

var colorBorderBrandPrimaryOnBgEmphasizedLight: ColorSemanticToken { get }

var colorBorderBrandPrimaryLight: MultipleColorSemanticTokens { get }

var colorBorderBrandPrimaryLight: ColorSemanticToken { get }
var colorBorderOnBrandPrimaryLight: MultipleColorSemanticTokens { get }

// MARK: Semantic token - Colors - Action

Expand Down Expand Up @@ -633,11 +641,19 @@ public protocol ColorSemanticTokens {

var colorBorderEmphasizedOnBgEmphasizedDark: ColorSemanticToken { get }

var colorBorderFocusDark: ColorSemanticToken { get }

var colorBorderFocusDark: MultipleColorSemanticTokens { get }

var colorBorderFocusInsetDark: MultipleColorSemanticTokens { get }

var colorBorderFocusInsetOnBgEmphasizedDark: MultipleColorSemanticTokens { get }

var colorBorderFocusOnBgEmphasizedDark: MultipleColorSemanticTokens { get }

var colorBorderBrandPrimaryOnBgEmphasizedDark: ColorSemanticToken { get }

var colorBorderBrandPrimaryDark: MultipleColorSemanticTokens { get }

var colorBorderBrandPrimaryDark: ColorSemanticToken { get }
var colorBorderOnBrandPrimaryDark: MultipleColorSemanticTokens { get }

// MARK: Semantic token - Colors - Action

Expand Down

0 comments on commit ec5e09e

Please sign in to comment.