Skip to content

Commit

Permalink
fix : theme support environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Tayebsed93 committed Oct 17, 2024
1 parent 81834f4 commit da6e278
Show file tree
Hide file tree
Showing 68 changed files with 152 additions and 140 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import SwiftUI
import OUDS
import OUDSComponents
import OUDSTokensSemantic
import OUDSThemesOrange
import OUDSThemesInverse

class OUDSComponentsUITests: XCTestCase {

Expand All @@ -25,7 +27,7 @@ class OUDSComponentsUITests: XCTestCase {
// MARK: - Orange Theme Light Mode Components Page Tests

func testComponents_OrangeTheme_Page_Light() {
let vc = ComponentsPage()
let vc = ComponentsPage().environment(\.theme, OrangeTheme())
assertSnapshot(of: vc, as: .image, named: "OrangeTheme/testComponents_OrangeTheme_Page_Light")
}

Expand All @@ -34,7 +36,7 @@ class OUDSComponentsUITests: XCTestCase {
// MARK: - Inverse Theme Light Mode Components Page Tests

func testComponents_InverseTheme_Page_Light() {
let vc = ComponentsPage()
let vc = ComponentsPage().environment(\.theme, InverseTheme())
assertSnapshot(of: vc, as: .image, named: "OrangeTheme/testComponents_InverseTheme_Page_Light")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import SwiftUI
import OUDS
import OUDSComponents
import OUDSTokensSemantic
import OUDSThemesOrange
import OUDSThemesInverse

class OUDSTokensBorderUITests: XCTestCase {

Expand All @@ -27,37 +29,37 @@ class OUDSTokensBorderUITests: XCTestCase {
// MARK: - Width Tokens Tests

func testBorderToken_OrangeTheme_SectionWidth_BorderWidthNone_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, OrangeTheme())
assertSnapshot(of: vc, as: .image, named: "OrangeTheme/testBorderToken_OrangeTheme_SectionWidth_BorderWidthNone_Light")
}

func testBorderToken_OrangeTheme_SectionWidth_BorderWidthDefault_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, OrangeTheme())
assertSnapshot(of: vc, as: .image, named: "OrangeTheme/testBorderToken_OrangeTheme_SectionWidth_BorderWidthDefault_Light")
}

func testBorderToken_OrangeTheme_SectionWidth_BorderWidthThin_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, OrangeTheme())
assertSnapshot(of: vc, as: .image, named: "OrangeTheme/testBorderToken_OrangeTheme_SectionWidth_BorderWidthThin_Light")
}

func testBorderToken_OrangeTheme_SectionWidth_BorderWidthMedium_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, OrangeTheme())
assertSnapshot(of: vc, as: .image, named: "OrangeTheme/testBorderToken_OrangeTheme_SectionWidth_BorderWidthMedium_Light")
}

func testBorderToken_OrangeTheme_SectionWidth_BorderWidthThick_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, OrangeTheme())
assertSnapshot(of: vc, as: .image, named: "OrangeTheme/testBorderToken_OrangeTheme_SectionWidth_BorderWidthThick_Light")
}

func testBorderToken_OrangeTheme_SectionWidth_BorderWidthThicker_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, OrangeTheme())
assertSnapshot(of: vc, as: .image, named: "OrangeTheme/testBorderToken_OrangeTheme_SectionWidth_BorderWidthThicker_Light")
}

func testBorderToken_OrangeTheme_SectionWidth_BorderWidthOutsideFocus_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, OrangeTheme())
assertSnapshot(of: vc, as: .image, named: "OrangeTheme/testBorderToken_OrangeTheme_SectionWidth_BorderWidthOutsideFocus_Light")
}

Expand All @@ -66,27 +68,27 @@ class OUDSTokensBorderUITests: XCTestCase {
// MARK: - Radius Tokens Tests

func testBorderToken_OrangeTheme_SectionRadius_BorderRadiusNone_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, OrangeTheme())
assertSnapshot(of: vc, as: .image, named: "OrangeTheme/testBorderToken_OrangeTheme_SectionRadius_BorderRadiusNone_Light")
}

func testBorderToken_OrangeTheme_SectionRadius_BorderRadiusDefault_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, OrangeTheme())
assertSnapshot(of: vc, as: .image, named: "OrangeTheme/testBorderToken_OrangeTheme_SectionRadius_BorderRadiusDefault_Light")
}

func testBorderToken_OrangeTheme_SectionRadius_BorderRadiusShort_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, OrangeTheme())
assertSnapshot(of: vc, as: .image, named: "OrangeTheme/testBorderToken_OrangeTheme_SectionRadius_BorderRadiusShort_Light")
}

func testBorderToken_OrangeTheme_SectionRadius_BorderRadiusMedium_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, OrangeTheme())
assertSnapshot(of: vc, as: .image, named: "OrangeTheme/testBorderToken_OrangeTheme_SectionRadius_BorderRadiusMedium_Light")
}

func testBorderToken_OrangeTheme_SectionRadius_BorderRadiusTall_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, OrangeTheme())
assertSnapshot(of: vc, as: .image, named: "OrangeTheme/testBorderToken_OrangeTheme_SectionRadius_BorderRadiusTall_Light")
}

Expand All @@ -95,12 +97,12 @@ class OUDSTokensBorderUITests: XCTestCase {
// MARK: - Style Tokens Tests

func testBorderToken_OrangeTheme_SectionStyle_BorderStyleDefault_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, OrangeTheme())
assertSnapshot(of: vc, as: .image, named: "OrangeTheme/testBorderToken_OrangeTheme_SectionStyle_BorderStyleDefault_Light")
}

func testBorderToken_OrangeTheme_SectionStyle_BorderStyleDrag_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, OrangeTheme())
assertSnapshot(of: vc, as: .image, named: "OrangeTheme/testBorderToken_OrangeTheme_SectionStyle_BorderStyleDrag_Light")
}

Expand All @@ -111,37 +113,37 @@ class OUDSTokensBorderUITests: XCTestCase {
// MARK: - Width Tokens Tests

func testBorderToken_InverseTheme_SectionWidth_BorderWidthNone_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, InverseTheme())
assertSnapshot(of: vc, as: .image, named: "InverseTheme/testBorderToken_InverseTheme_SectionWidth_BorderWidthNone_Light")
}

func testBorderToken_InverseTheme_SectionWidth_BorderWidthDefault_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, InverseTheme())
assertSnapshot(of: vc, as: .image, named: "InverseTheme/testBorderToken_InverseTheme_SectionWidth_BorderWidthDefault_Light")
}

func testBorderToken_InverseTheme_SectionWidth_BorderWidthThin_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, InverseTheme())
assertSnapshot(of: vc, as: .image, named: "InverseTheme/testBorderToken_InverseTheme_SectionWidth_BorderWidthThin_Light")
}

func testBorderToken_InverseTheme_SectionWidth_BorderWidthMedium_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, InverseTheme())
assertSnapshot(of: vc, as: .image, named: "InverseTheme/testBorderToken_InverseTheme_SectionWidth_BorderWidthMedium_Light")
}

func testBorderToken_InverseTheme_SectionWidth_BorderWidthThick_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, InverseTheme())
assertSnapshot(of: vc, as: .image, named: "InverseTheme/testBorderToken_InverseTheme_SectionWidth_BorderWidthThick_Light")
}

func testBorderToken_InverseTheme_SectionWidth_BorderWidthThicker_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, InverseTheme())
assertSnapshot(of: vc, as: .image, named: "InverseTheme/testBorderToken_InverseTheme_SectionWidth_BorderWidthThicker_Light")
}

func testBorderToken_InverseTheme_SectionWidth_BorderWidthOutsideFocus_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, InverseTheme())
assertSnapshot(of: vc, as: .image, named: "InverseTheme/testBorderToken_InverseTheme_SectionWidth_BorderWidthOutsideFocus_Light")
}
}
Expand All @@ -151,27 +153,27 @@ class OUDSTokensBorderUITests: XCTestCase {
// MARK: - Radius Tokens Tests

func testBorderToken_InverseTheme_SectionRadius_BorderRadiusNone_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, InverseTheme())
assertSnapshot(of: vc, as: .image, named: "InverseTheme/testBorderToken_OrangeTheme_SectionRadius_BorderRadiusNone_Light")
}

func testBorderToken_InverseTheme_SectionRadius_BorderRadiusDefault_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, InverseTheme())
assertSnapshot(of: vc, as: .image, named: "InverseTheme/testBorderToken_OrangeTheme_SectionRadius_BorderRadiusDefault_Light")
}

func testBorderToken_InverseTheme_SectionRadius_BorderRadiusShort_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, InverseTheme())
assertSnapshot(of: vc, as: .image, named: "InverseTheme/testBorderToken_OrangeTheme_SectionRadius_BorderRadiusShort_Light")
}

func testBorderToken_InverseTheme_SectionRadius_BorderRadiusMedium_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, InverseTheme())
assertSnapshot(of: vc, as: .image, named: "InverseTheme/testBorderToken_OrangeTheme_SectionRadius_BorderRadiusMedium_Light")
}

func testBorderToken_InverseTheme_SectionRadius_BorderRadiusTall_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, InverseTheme())
assertSnapshot(of: vc, as: .image, named: "InverseTheme/testBorderToken_OrangeTheme_SectionRadius_BorderRadiusTall_Light")
}

Expand All @@ -180,11 +182,11 @@ func testBorderToken_InverseTheme_SectionRadius_BorderRadiusTall_Light() {
// MARK: - Style Tokens Tests

func testBorderToken_InverseTheme_SectionStyle_BorderStyleDefault_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, InverseTheme())
assertSnapshot(of: vc, as: .image, named: "InverseTheme/testBorderToken_OrangeTheme_SectionStyle_BorderStyleDefault_Light")
}

func testBorderToken_InverseTheme_SectionStyle_BorderStyleDrag_Light() {
let vc = BorderTokenPage()
let vc = BorderTokenPage().environment(\.theme, InverseTheme())
assertSnapshot(of: vc, as: .image, named: "InverseTheme/testBorderToken_OrangeTheme_SectionStyle_BorderStyleDrag_Light")
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit da6e278

Please sign in to comment.