Skip to content

Commit 6c16acd

Browse files
committed
test: update snapshots for Orange-OpenSource/ouds-ios#1588
Signed-off-by: Pierre-Yves Lapersonne <pierreyves.lapersonne@orange.com>
1 parent 33b1c9b commit 6c16acd

656 files changed

Lines changed: 20 additions & 7 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 2 additions & 1 deletion

DesignToolbox/DesignToolboxSnapshotsTests/__Snapshots__/Components/Test Cases/Components/Controls/ChipsSnapshotsTestsTestCase.swift

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ open class ChipsSnapshotsTestsTestCase: XCTestCase {
4242
model.enabled = enabled
4343
model.iconType = iconType
4444

45-
testSuggestionChips(theme: theme, interfaceStyle: interfaceStyle, model: model)
45+
testSuggestionChips(theme: theme, interfaceStyle: interfaceStyle, model: model, isLongText: false)
46+
47+
model.text = "¡ Bravas patatas ! ¡ Patatas bravas ! ¡ Patatata-patatata-patatas bravas !"
48+
testSuggestionChips(theme: theme, interfaceStyle: interfaceStyle, model: model, isLongText: true)
4649
}
4750
}
4851
}
@@ -59,7 +62,10 @@ open class ChipsSnapshotsTestsTestCase: XCTestCase {
5962
model.enabled = enabled
6063
model.iconType = iconType
6164

62-
testFilterChips(theme: theme, interfaceStyle: interfaceStyle, model: model)
65+
testFilterChips(theme: theme, interfaceStyle: interfaceStyle, model: model, isLongText: false)
66+
67+
model.text = "¡ Bravas patatas ! ¡ Patatas bravas ! ¡ Patatata-patatata-patatas bravas !"
68+
testFilterChips(theme: theme, interfaceStyle: interfaceStyle, model: model, isLongText: true)
6369
}
6470
}
6571
}
@@ -77,9 +83,11 @@ open class ChipsSnapshotsTestsTestCase: XCTestCase {
7783
/// - theme: The theme (OUDSTheme)
7884
/// - interfaceStyle: The user interface style (light or dark)
7985
/// - model: The model contains each element of configuration
86+
/// - isLongText: Flag to rise to record in the snapshot file name the text of the chip is considered long
8087
@MainActor func testFilterChips(theme: OUDSTheme,
8188
interfaceStyle: UIUserInterfaceStyle,
82-
model: FilterChipConfigurationModel)
89+
model: FilterChipConfigurationModel,
90+
isLongText: Bool)
8391
{
8492
// Generate the illustration for the specified configuration
8593
let illustration = OUDSThemeableView(theme: theme) {
@@ -95,7 +103,8 @@ open class ChipsSnapshotsTestsTestCase: XCTestCase {
95103
let disabledPattern = !model.enabled ? "_Disabled" : ""
96104
let selectedPattern = model.selected ? "_Selected" : ""
97105
let imageModePattern = model.layout != .textOnly ? (model.iconType == .image ? "_OriginalImage" : "_TemplateImage") : ""
98-
let name = "\(model.layout.debugDescription)\(imageModePattern)\(selectedPattern)\(disabledPattern)"
106+
let textLengthPattern = isLongText ? "_LongText" : "_ShortText"
107+
let name = "\(model.layout.debugDescription)\(imageModePattern)\(textLengthPattern)\(selectedPattern)\(disabledPattern)"
99108

100109
// Capture the snapshot of the illustration with the correct user interface style and save it with the snapshot name
101110
assertIllustration(illustration,
@@ -115,9 +124,11 @@ open class ChipsSnapshotsTestsTestCase: XCTestCase {
115124
/// - theme: The theme (OUDSTheme)
116125
/// - interfaceStyle: The user interface style (light or dark)
117126
/// - model: The model contains each element of configuration
127+
/// - isLongText: Flag to rise to record in the snapshot file name the text of the chip is considered long
118128
@MainActor func testSuggestionChips(theme: OUDSTheme,
119129
interfaceStyle: UIUserInterfaceStyle,
120-
model: SuggestionChipConfigurationModel)
130+
model: SuggestionChipConfigurationModel,
131+
isLongText: Bool)
121132
{
122133
// Generate the illustration for the specified configuration
123134
let illustration = OUDSThemeableView(theme: theme) {
@@ -131,7 +142,8 @@ open class ChipsSnapshotsTestsTestCase: XCTestCase {
131142
let testName = "testSuggestion_\(theme.name)Theme_\(interfaceStyle == .light ? "Light" : "Dark")"
132143
let disabledPattern = !model.enabled ? "_Disabled" : ""
133144
let imageModePattern = model.layout != .textOnly ? (model.iconType == .image ? "_OriginalImage" : "_TemplateImage") : ""
134-
let name = "\(model.layout.debugDescription)\(imageModePattern)\(disabledPattern)"
145+
let textLengthPattern = isLongText ? "_LongText" : "_ShortText"
146+
let name = "\(model.layout.debugDescription)\(imageModePattern)\(textLengthPattern)\(disabledPattern)"
135147

136148
// Capture the snapshot of the illustration with the correct user interface style and save it with the snapshot name
137149
assertIllustration(illustration,

0 commit comments

Comments
 (0)