File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -214,6 +214,18 @@ private struct ButtonTestView: View {
214
214
}
215
215
}
216
216
217
+ @available ( macOS 10 . 15 . 0 , * )
218
+ private struct ToggleTestView : View {
219
+ let spy : ( ) -> Void
220
+ @State private var toggleValue = false
221
+ var body : some View {
222
+ Toggle ( " Toggle " , isOn: $toggleValue)
223
+ . introspectButton { button in
224
+ self . spy ( )
225
+ }
226
+ }
227
+ }
228
+
217
229
@available ( macOS 11 . 0 , * )
218
230
private struct ColorWellTestView : View {
219
231
@State private var color = Color . black
@@ -381,6 +393,16 @@ class AppKitTests: XCTestCase {
381
393
wait ( for: [ expectation] , timeout: TestUtils . Constants. timeout)
382
394
}
383
395
396
+ func testToggle( ) {
397
+
398
+ let expectation = XCTestExpectation ( )
399
+ let view = ToggleTestView ( spy: {
400
+ expectation. fulfill ( )
401
+ } )
402
+ TestUtils . present ( view: view)
403
+ wait ( for: [ expectation] , timeout: TestUtils . Constants. timeout)
404
+ }
405
+
384
406
func testColorPicker( ) {
385
407
386
408
if #available( macOS 11 . 0 , * ) {
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ List | UITableView | NSTableView | `.introspectTableView()`
57
57
View in List | UITableViewCell | NSTableCellView | ` introspectTableViewCell() `
58
58
TabView | UITabBarController | NSTabView | ` .introspectTabBarController() ` (iOS) <br /> ` .introspectTabView() ` (macOS)
59
59
TextField | UITextField | NSTextField | ` .introspectTextField() `
60
- Toggle | UISwitch | _ N/A _ | ` .introspectSwitch() `
60
+ Toggle | UISwitch | NSButton | ` .introspectSwitch() ` (iOS) < br /> ` .introspectButton() ` (macOS)
61
61
Slider | UISlider | NSSlider | ` .introspectSlider() `
62
62
Stepper | UIStepper | NSStepper | ` .introspectStepper() `
63
63
DatePicker | UIDatePicker | NSDatePicker | ` .introspectDatePicker() `
@@ -197,4 +197,4 @@ $ bundle exec pod trunk push .
197
197
198
198
[ Siteline_Badge ] : https://badgen.net/badge/Built%20by/Siteline/blue?icon=https://uploads-ssl.webflow.com/5f4513afbbfc64c4777fcccf/5f525b122370d681879e170e_siteline-icon.svg
199
199
200
- [ Quintschaf_Badge ] : https://badgen.net/badge/Maintained%20by/Quintschaf/cyan?icon=https://quintschaf.com/assets/logo.svg
200
+ [ Quintschaf_Badge ] : https://badgen.net/badge/Maintained%20by/Quintschaf/cyan?icon=https://quintschaf.com/assets/logo.svg
You can’t perform that action at this time.
0 commit comments