updated package + tests

This commit is contained in:
Mauro Romito
2022-10-28 14:15:18 +02:00
parent 10b107bc32
commit a9fa0b92e2
4 changed files with 38 additions and 6 deletions

View File

@@ -23,7 +23,7 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/matrix-org/matrix-wysiwyg-composer-swift",
"state" : {
"revision" : "d5ef7054fb43924d5b92d5d627347ca2bc333717"
"revision" : "3cafc52d257411e06d4be4d0e2cdeeb4bd4b7099"
}
},
{

View File

@@ -45,6 +45,41 @@ final class ComposerUITests: MockScreenTestCase {
XCTAssertTrue(maximiseButton.exists)
}
// This test requires "connect hardware keyboard" to be off on the simulator
func testFastTyping() {
app.goToScreenWithIdentifier(MockComposerScreenState.send.title)
let text = "Some text that should be typed very fast!"
let wysiwygTextView = app.textViews.allElementsBoundByIndex[0]
wysiwygTextView.tap()
sleep(1)
wysiwygTextView.typeText(text)
XCTAssert(wysiwygTextView.value as? String == text)
}
// This test requires "connect hardware keyboard" to be off on the simulator
func testLongPressDelete() {
app.goToScreenWithIdentifier(MockComposerScreenState.send.title)
let text =
"""
Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10
"""
let wysiwygTextView = app.textViews.allElementsBoundByIndex[0]
wysiwygTextView.tap()
sleep(1)
wysiwygTextView.typeText(text)
XCUIApplication().keys["delete"].press(forDuration: 10.0)
XCTAssert(wysiwygTextView.value as? String == "")
}
func testReplyMode() throws {
app.goToScreenWithIdentifier(MockComposerScreenState.reply.title)

View File

@@ -112,10 +112,7 @@ struct Composer: View {
HStack(alignment: .top, spacing: 0) {
WysiwygComposerView(
focused: $focused,
content: wysiwygViewModel.content,
replaceText: wysiwygViewModel.replaceText,
select: wysiwygViewModel.select,
didUpdateText: wysiwygViewModel.didUpdateText
viewModel: wysiwygViewModel
)
.tintColor(theme.colors.accent)
.placeholder(viewModel.viewState.placeholder, color: theme.colors.tertiaryContent)

View File

@@ -53,7 +53,7 @@ packages:
branch: main
WysiwygComposer:
url: https://github.com/matrix-org/matrix-wysiwyg-composer-swift
revision: d5ef7054fb43924d5b92d5d627347ca2bc333717
revision: 3cafc52d257411e06d4be4d0e2cdeeb4bd4b7099
DeviceKit:
url: https://github.com/devicekit/DeviceKit
majorVersion: 4.7.0