Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tests] Reactor UI test to use theme in environment #299

Open
1 task done
ludovic35 opened this issue Nov 21, 2024 · 0 comments · May be fixed by #314
Open
1 task done

[Tests] Reactor UI test to use theme in environment #299

ludovic35 opened this issue Nov 21, 2024 · 0 comments · May be fixed by #314
Assignees
Labels
🔍 triage A new issue that needs to be treated

Comments

@ludovic35
Copy link
Member

ludovic35 commented Nov 21, 2024

Prerequisites

As a

developper

... I want to

simplify API

... so that I can

use theme in environment in view without the forceTheme in API

Motivation and context

Today for Border the OUDSBorder propose
init(forceTo theme: OUDSTheme? = nil, colorScheme: ColorScheme? = nil) {
forcedTheme = theme
forcedColorScheme = colorScheme
}

to remove this init we should wrapp the OUDSBorder into the OUDSThemeableViewlike this

OUDSThemeableView(theme: theme) {
    OUDSBorder()
}

Proposed Solution

In the test UI content:

   for borderWidth in NamedBorderWidth.allCases {
          let illustration = OUDSThemeableView(theme: theme) {
                OUDSBorder().illustration(for: borderWidth)
                    .background(self.orangeTheme.colorBgPrimary.color(for: self.lightScheme))
            }

            let hostingVC = UIHostingController(rootView: illustration)
            let snapshotName = "\(theme.name)_\(scaled.rawValue)_\(interfaceStyle == .light ? "Light" : "Dark")"
            assertSnapshot(of: hostingVC, as: .image(traits: UITraitCollection(userInterfaceStyle: interfaceStyle)), named: snapshotName)
        }

Other

No response

Contact Details

No response

@ludovic35 ludovic35 added the 🔍 triage A new issue that needs to be treated label Nov 21, 2024
@pylapp pylapp changed the title [TestUI] Reactor UI test to use theme in environment [Tests] Reactor UI test to use theme in environment Nov 21, 2024
@Tayebsed93 Tayebsed93 self-assigned this Nov 22, 2024
@Tayebsed93 Tayebsed93 linked a pull request Nov 26, 2024 that will close this issue
16 tasks
@Tayebsed93 Tayebsed93 linked a pull request Nov 26, 2024 that will close this issue
16 tasks
@ludovic35 ludovic35 moved this from Todo to In Progress in [OUDS] Project Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔍 triage A new issue that needs to be treated
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants