Skip to content

The agent that grows with you

test(desktop): no-native-title covers RowButton

Brooklyn Nicholson792e0e639bca
diff --git a/apps/desktop/src/components/ui/__tests__/no-native-title.test.ts b/apps/desktop/src/components/ui/__tests__/no-native-title.test.ts
index 44bd0bbeceb..6dc06273779 100644
--- a/apps/desktop/src/components/ui/__tests__/no-native-title.test.ts
+++ b/apps/desktop/src/components/ui/__tests__/no-native-title.test.ts
@@ -37,11 +37,13 @@ function collectTsxFiles(dir: string): string[] {
return results
}
-/** Every `<button …>` / `<Button …>` opening tag in `content`, with the
- * attribute text up to the tag's real closing `>`. */
+/** Every button-element opening tag in `content` — native `<button>`, the
+ * `<Button>` primitive, and `<RowButton>` (a bare `<button>` that forwards
+ * every prop) — with the attribute text up to the tag's real `>`. Wrappers
+ * with their own `title` prop (CopyButton, …) render it through Tip. */
function eachButtonOpenTag(content: string): Array<{ attrs: string; index: number; tagName: string }> {
const tags: Array<{ attrs: string; index: number; tagName: string }> = []
- const openPattern = /<(Button|button)\b/gu
+ const openPattern = /<(Button|button|RowButton)\b/gu
let match: RegExpExecArray | null
while ((match = openPattern.exec(content)) !== null) {
@@ -139,7 +141,8 @@ describe('no native title= on button elements', () => {
const flagged = [
'<button onClick={() => {}} title="probe">hi</button>',
'<Button\n onClick={event => {\n event.preventDefault()\n }}\n // macOS doesn\'t focus a button on mousedown\n title={copy.send}\n type="button"\n>',
- "<button className={cn(saved ? 'a' : 'b')} title={on ? m.off(t) : m.on(t)}>"
+ "<button className={cn(saved ? 'a' : 'b')} title={on ? m.off(t) : m.on(t)}>",
+ '<RowButton onClick={pick} title={hint}>'
]
const clean = [