Skip to content

Commit

Permalink
feat(BottomSheet): Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WanaldinoTelefonica committed Aug 18, 2023
1 parent b490aeb commit 847decc
Show file tree
Hide file tree
Showing 181 changed files with 43 additions and 5 deletions.
48 changes: 43 additions & 5 deletions Tests/MisticaTests/UI/SheetTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -189,26 +189,40 @@ final class SheetTests: XCTestCase {

// MARK: Action list type

func testActionWithoutUrls() {
func testActionListWithoutUrls() {
assertSnapshotForAllBrandsAndStyles(
as: .image(on: .iPhoneSe),
viewBuilder: sheetView(
title: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
subtitle: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
description: "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
content: makeActionContent()
content: makeActionListContent()
)
)
}

func testActionWithUrls() {
func testActionListWithUrls() {
assertSnapshotForAllBrandsAndStyles(
as: .image(on: .iPhoneSe),
viewBuilder: sheetView(
title: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
subtitle: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
description: "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
content: makeActionContent(url: iconPath, urlDark: iconPath)
content: makeActionListContent(url: iconPath, urlDark: iconPath)
)
)
}

// MARK: Actions

func testAction() {
assertSnapshotForAllBrandsAndStyles(
as: .image(on: .iPhoneSe),
viewBuilder: sheetView(
title: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
subtitle: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
description: "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
content: makeActionContent()
)
)
}
Expand Down Expand Up @@ -270,7 +284,7 @@ private extension SheetTests {
return [content]
}

func makeActionContent(
func makeActionListContent(
url: String? = nil,
urlDark: String? = nil
) -> [SheetList] {
Expand All @@ -287,6 +301,30 @@ private extension SheetTests {
)
rows.append(item)
}
let content = SheetList(
id: UUID().uuidString,
listType: .actionList(items: rows),
autoSubmit: true,
selectedId: []
)

return [content]
}

func makeActionContent() -> [SheetList] {
var rows: [ActionItem] = []
for index in 1 ... 10 {
let style = index <= 5 ? Button.Style.primary : .link
let rightImage = index <= 5 ? nil : Button.RightImage.chevron

let item = ActionItem(
id: "\(index)",
style: style,
title: "Title \(index)",
rightImage: rightImage
)
rows.append(item)
}
let content = SheetList(
id: UUID().uuidString,
listType: .actions(items: rows),
Expand Down
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
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
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
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.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.

0 comments on commit 847decc

Please sign in to comment.