Skip to content

Commit

Permalink
Runs introspect callback when editor view is created (#74)
Browse files Browse the repository at this point in the history
* Runs introspect callback on init editor

* Runs introspect on create in UIKit editor

* Updates UIKit tests for iPhone 14 Pro
  • Loading branch information
kyle-n authored Aug 22, 2023
1 parent 843c710 commit 759d7b4
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public struct HighlightedTextEditor: NSViewRepresentable, HighlightingTextEditor
public func makeNSView(context: Context) -> ScrollableTextView {
let textView = ScrollableTextView()
textView.delegate = context.coordinator
runIntrospect(textView)

return textView
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public struct HighlightedTextEditor: UIViewRepresentable, HighlightingTextEditor
let textView = UITextView()
textView.delegate = context.coordinator
updateTextViewModifiers(textView)
runIntrospect(textView)

return textView
}
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.
6 changes: 5 additions & 1 deletion Tests/Essayist/iOS-EssayistUITests/iOS_EssayistUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ class iOS_EssayistUITests: XCTestCase {
// enable Chinese-language keyboard
let settings = XCUIApplication(bundleIdentifier: "com.apple.Preferences")
settings.launch()
sleep(1)
settings.terminate()
sleep(1)
settings.launch()

settings.tables.firstMatch.staticTexts["General"].tap()
settings.tables.firstMatch.staticTexts["Keyboard"].tap()
Expand Down Expand Up @@ -71,7 +75,7 @@ class iOS_EssayistUITests: XCTestCase {
app.textViews.firstMatch.tap()
}
nextKeyboardButton.press(forDuration: 0.9)
app.tables["InputSwitcherTable"].staticTexts[keyboardType.rawValue].tap()
app.staticTexts[keyboardType.rawValue].firstMatch.tap()
}

func testMarkdownPresetHighlighting() {
Expand Down

0 comments on commit 759d7b4

Please sign in to comment.