Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): follow prose direction in pull request editors #48233

OpenDananz(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/48233/headopened View on GitHub

Showing 2 changed files with 21 additions and 0 deletions.

x
0 of 2 viewed, 2 left
19 additions and 0 deletionsapps/web/src/components/pullRequest/PullRequestMarkdownEditor.browser.test.tsxModified
View file
@@ -102,6 +102,25 @@
});
​
+it("updates the draft direction as the prose changes", async () => {
+ setup();
+ permissions.allowed.add(secondary);
+ await using screen = await openEditor({ value: "Review the changes." });
+ const textarea = screen.container.querySelector("textarea")!;
+​
+ expect(getComputedStyle(textarea).direction).toBe("ltr");
+​
+ const hebrew = "Review בבקשה בדוק את התיקון לפני המיזוג.";
+ await userEvent.fill(textarea, hebrew);
+ expect(textarea.value).toBe(hebrew);
+ expect(getComputedStyle(textarea).direction).toBe("rtl");
+​
+ const english = "Review the example `בבקשה בדוק את התיקון לפני המיזוג`.";
+ await userEvent.fill(textarea, english);
+ expect(textarea.value).toBe(english);
+ expect(getComputedStyle(textarea).direction).toBe("ltr");
+});
+​
it("keeps an edited draft through revocation and saves it after access returns without remounting", async () => {
setup();
permissions.allowed.add(secondary);
2 additions and 0 deletionsapps/web/src/components/pullRequest/PullRequestMarkdownTextarea.tsxModified
View file