Skip to content

Commit

Permalink
Merge pull request #48 from dscyrescotti/develop
Browse files Browse the repository at this point in the history
Release | Version 2.0.1
  • Loading branch information
dscyrescotti authored Dec 16, 2022
2 parents 601a1f3 + 096e8ee commit e3c2cb0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
.package(url: "https://github.com/dscyrescotti/ViewInspector.git", branch: "master"),
.package(url: "https://github.com/nalexn/ViewInspector.git", from: "0.9.2"),
],
targets: [
.target(
Expand Down
4 changes: 1 addition & 3 deletions Sources/Utils/PreferenceKeys/SizePreferenceKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ public struct SizePreferenceKey: PreferenceKey {

public static var defaultValue: Value = .zero

public static func reduce(value: inout Value, nextValue: () -> Value) {
value = nextValue()
}
public static func reduce(value: inout Value, nextValue: () -> Value) { }
}
25 changes: 25 additions & 0 deletions Tests/ShuffleItTests/CarouselStack/CarouselStackTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,31 @@ final class CarouselStackTests: BaseTestCase {
ViewHosting.host(view: view, size: .init(width: 300, height: 800))
self.wait(for: [exp], timeout: 0.5)
}

func testCarouselStackStatesWithButton() throws {
let view = CarouselStack(colors) { color in
HStack {
Button(action: { }) {
Text("Button")
}
}
.frame(maxWidth: .infinity)
.frame(height: 200)
.background(color)
}
let exp = view.inspection.inspect(after: 0.2) { view in
let sut = try view.actualView()
let width = 300 - sut.padding * 2
XCTAssertEqual(sut.index, 0)
XCTAssertEqual(sut.xPosition, 0)
XCTAssertEqual(sut.direction, .left)
XCTAssertEqual(sut.size, .init(width: width, height: 200))
XCTAssertEqual(sut.autoSliding, false)
XCTAssertEqual(sut.isActiveGesture, false)
}
ViewHosting.host(view: view, size: .init(width: 300, height: 800))
self.wait(for: [exp], timeout: 0.5)
}

#if !os(tvOS)
func testCarouselStackDisabled() throws {
Expand Down

0 comments on commit e3c2cb0

Please sign in to comment.