Skip to content

Commit 7665db9

Browse files
authored
chore(text-restrictions): update line breaks test cases (#103)
1 parent bdc74a0 commit 7665db9

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tests/src/rules/text-restrictions.test.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const wordRule: RestrictionRule = {
2121
}
2222

2323
const lineBreakRule: RestrictionRule = {
24-
patterns: ['\n', '\r\n'],
24+
patterns: ['^\n', '\n$', '^\r\n', '\r\n$'],
2525
message: `No line breaks`,
2626
}
2727

@@ -105,6 +105,19 @@ ruleTester.run<string, Option[]>('text-restrictions (ts)', rule, {
105105
},
106106
],
107107
},
108+
{
109+
code: `
110+
<Trans>
111+
hello
112+
world
113+
</Trans>
114+
`,
115+
options: [
116+
{
117+
rules: [lineBreakRule],
118+
},
119+
],
120+
},
108121
{
109122
code: '<div>&lt;<Trans>email</Trans></div>',
110123
options: [

0 commit comments

Comments
 (0)