fixes cursor
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
@testable import HelderUI
|
||||
import Testing
|
||||
|
||||
@Suite struct PointerPolicyTests {
|
||||
private func shape(layer: PointerLayer = .workspace, overlayOpen: Bool = false, isEnabled: Bool = true,
|
||||
isOverText: Bool = true, isSelecting: Bool = false) -> PointerShape {
|
||||
PointerPolicy.shape(PointerState(layer: layer, overlayOpen: overlayOpen, isEnabled: isEnabled,
|
||||
isOverText: isOverText, isSelecting: isSelecting))
|
||||
}
|
||||
|
||||
@Test func textUnderThePointerTakesTheIBeam() {
|
||||
#expect(shape() == .iBeam)
|
||||
#expect(shape(layer: .overlay, overlayOpen: true) == .iBeam)
|
||||
}
|
||||
|
||||
@Test func everythingThatIsNotTextKeepsTheArrow() {
|
||||
#expect(shape(isOverText: false) == .arrow)
|
||||
#expect(shape(layer: .overlay, overlayOpen: true, isOverText: false) == .arrow)
|
||||
}
|
||||
|
||||
@Test func anOpenOverlayGivesTheColumnsBehindItTheArrow() {
|
||||
#expect(shape(overlayOpen: true) == .arrow)
|
||||
}
|
||||
|
||||
@Test func aDisabledOrHiddenTextViewKeepsTheArrow() {
|
||||
#expect(shape(isEnabled: false) == .arrow)
|
||||
#expect(shape(layer: .overlay, overlayOpen: true, isEnabled: false) == .arrow)
|
||||
}
|
||||
|
||||
@Test func aDragSelectionKeepsTheIBeamUntilMouseUpWhereverItGoes() {
|
||||
#expect(shape(isOverText: false, isSelecting: true) == .iBeam)
|
||||
#expect(shape(overlayOpen: true, isEnabled: false, isOverText: false, isSelecting: true) == .iBeam)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user