Skip to content

Commit

Permalink
fix: restore more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillzyusko committed May 10, 2024
1 parent 21d11f0 commit fd7a545
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
20 changes: 9 additions & 11 deletions e2e/kit/003-input-handlers.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,20 @@ describe("input handlers functionality", () => {
await waitForElementById("masked_input");
await waitAndTap("masked_input");
// make sure keyboard is shown
await delay(5000);
await delay(500);
await waitAndType("masked_input", "1234567890");
await expect(element(by.id("formatted_text"))).toHaveText(
"Formatted: +1 (123) 456 78 90",
);
await expect(element(by.id("extracted_text"))).toHaveText(
"Extracted: 1234567890",
);
/*await expect(element(by.id("worklet_text"))).toHaveText(
await expect(element(by.id("worklet_text"))).toHaveText(
"Worklet: +1 (123) 456 78 90",
);*/
await delay(10000);
);
});

it("should fire `onSelectionChange` with expected values", async () => {
await delay(10000);
/*await waitFor(element(by.id("selection_text_start_end")))
.toHaveText("start: 18, end: 18")
.withTimeout(DEFAULT_TIMEOUT);
Expand All @@ -49,9 +47,9 @@ describe("input handlers functionality", () => {
await waitFor(element(by.id("formatted_text")))
.toHaveText("Formatted: QWERTY\nqwerty")
.withTimeout(DEFAULT_TIMEOUT);
/*await waitFor(element(by.id("worklet_text")))
await waitFor(element(by.id("worklet_text")))
.toHaveText("Worklet: QWERTY\nqwerty")
.withTimeout(DEFAULT_TIMEOUT);*/
.withTimeout(DEFAULT_TIMEOUT);
await waitFor(element(by.id("selection_text_start_end")))
.toHaveText("start: 13, end: 13")
.withTimeout(DEFAULT_TIMEOUT);
Expand All @@ -65,9 +63,9 @@ describe("input handlers functionality", () => {
await waitFor(element(by.id("formatted_text")))
.toHaveText("Formatted: QWERTY")
.withTimeout(DEFAULT_TIMEOUT);
/*await waitFor(element(by.id("worklet_text")))
await waitFor(element(by.id("worklet_text")))
.toHaveText("Worklet: QWERTY")
.withTimeout(DEFAULT_TIMEOUT);*/
.withTimeout(DEFAULT_TIMEOUT);
await waitFor(element(by.id("selection_text_start_end")))
.toHaveText("start: 6, end: 6")
.withTimeout(DEFAULT_TIMEOUT);
Expand All @@ -80,9 +78,9 @@ describe("input handlers functionality", () => {
await waitFor(element(by.id("formatted_text")))
.toHaveText("Formatted: QWERT")
.withTimeout(DEFAULT_TIMEOUT);
/*await waitFor(element(by.id("worklet_text")))
await waitFor(element(by.id("worklet_text")))
.toHaveText("Worklet: QWERT")
.withTimeout(DEFAULT_TIMEOUT);*/
.withTimeout(DEFAULT_TIMEOUT);
await waitFor(element(by.id("selection_text_start_end")))
.toHaveText("start: 5, end: 5")
.withTimeout(DEFAULT_TIMEOUT);
Expand Down
Binary file not shown.
8 changes: 4 additions & 4 deletions ios/delegates/KCTextInputCompositeDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ class KCTextInputCompositeDelegate: NSObject, UITextViewDelegate, UITextFieldDel
updateSelectionPosition(textInput: textView)
}

/*func textViewDidChange(_ textView: UITextView) {
func textViewDidChange(_ textView: UITextView) {
defer {
self.onTextChange(textView.text)
}

textViewDelegate?.textViewDidChange?(textView)
}*/
}

// MARK: UITextFieldDelegate

Expand All @@ -97,7 +97,7 @@ class KCTextInputCompositeDelegate: NSObject, UITextViewDelegate, UITextFieldDel
updateSelectionPosition(textInput: textField)
}

/*func textField(
func textField(
_ textField: UITextField,
shouldChangeCharactersIn range: NSRange,
replacementString string: String
Expand All @@ -107,7 +107,7 @@ class KCTextInputCompositeDelegate: NSObject, UITextViewDelegate, UITextFieldDel
}

return textFieldDelegate?.textField?(textField, shouldChangeCharactersIn: range, replacementString: string) ?? true
}*/
}

// MARK: call forwarding

Expand Down

0 comments on commit fd7a545

Please sign in to comment.