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

Closed
1 task done
ludovic35 opened this issue Nov 21, 2024 · 0 comments · Fixed by #314
Closed
1 task done

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

ludovic35 opened this issue Nov 21, 2024 · 0 comments · 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
@ludovic35 ludovic35 moved this from Todo to In Progress in [OUDS] Project Nov 27, 2024
pylapp pushed a commit that referenced this issue Dec 4, 2024
…values (#299) (#314)

Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
Co-authored-by: Ludovic PINEL <[email protected]>
@github-project-automation github-project-automation bot moved this from In Progress to Done in [OUDS] Project Dec 4, 2024
This was referenced Dec 18, 2024
pylapp added a commit that referenced this issue Dec 18, 2024
Release of version 0.8.0
See bellow the full CHANGELOG details.

Added:
- [Library] New architecture with tokens provider ([#79](#79))
- [DemoApp] Prepare new architecture to add components illustration ([#328](#328))

Changed:
- [Tool] Update `net-http` gem from 0.5.0 to 0.6.0
- [Tool] Update `SwiftLint` pod from v0.57.0 to v0.57.1
- [Tool] Update `SwiftFormat/CLI` pod from v0.54.6 to v0.55.3
- [Tool] Update `fastlane` gem from v2.225.0 to v2.226.0
- [Library] Update `FontSemanticTokens` (tokenator *20241213075501*)
- [Library] Update `FontSemanticTokens` (tokenator *20241211115813*)
- [Library] Update `FontRawTokens` (tokenator *20241211101443*)
- [Tool] Migrate from `xcode_install` to `xcodes` in Fastfile, freeze Xcode version (16.0)
- [Library] Rename `Typography*` tokens and elements to `Font*` ([#322](#322))
- [Library] Update `ColorSemanticTokens` (tokenator *20241204111709*)
- [Library] Update `SpaceSemanticTokens` (tokenator *20241204110127*)
- [Library] Rename `opacityTransparent` opacity semantic token to `opacityInvisible`
- [Library] Update `OpacitySemanticTokens` and `OpacityRawTokens` tokens (tokenator *20241204110957*)
- [Library] Update `OrangeBrandColorRawTokens` tokens (tokenator *20241204111119*)
- [Library] Update `SizeSemanticTokens` tokens (tokenator *20241204110236*)
- [Library] Rename any `sizeIcon**` size semantic tokens applying "T-shirt sizes" template
- [Library] Update `ElevationSemanticTokens` and `ColorRawTokens` tokens (tokenator *20241204111249*)
- [Library] Rename any `colorTransparent*` color semantic tokens to `colorOpacity*`
- [DemoApp] Reactor UI test to use theme in environment ([#299](#299))

Removed:
- [Library] Font raw tokens `fontFamilyBrandDefault`, `fontFamilyBrandTV`, `fontFamilySystemArial`, `fontFamilySystemHelvetica`, `fontFamilySystemNotoSans`, `fontFamilySystemSFPro`, `fontFamilySystemRoboto`, `fontFamilyMonospaceMonaco`, `fontFamilyMonospaceCourierNew`, `fontFamilySystemArial`
- [Library] Space semantic tokens `*WithIcon*`, `*WithArrow*` 
- [Library] Elevation semantic tokens `elevationBlurOverlayDefault`, `elevationBlurOverlayEmphasized`, `elevationXOverlayDefault`, `elevationXOverlayEmphasized`, `elevationYOverlayDefault`, `elevationYOverlayEmphasized`, `elevationColorOverlayDefaultLight`, `elevationColorOverlayEmphasizedLight`, `elevationColorOverlayDefaultDark`, `elevationColorOverlayEmphasizedDark`

Co-authored-by: Pierre-Yves Lapersonne <[email protected]>
Co-authored-by: Ludovic Pinel <[email protected]>
Co-authored-by: boosted-bot <[email protected]>
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: Done
Development

Successfully merging a pull request may close this issue.

3 participants