Skip to content

Commit eaeb791

Browse files
committed
test(template-require-form-method): exercise default-enabled path with no options
With the rule default-enabled, `options: [true]` is redundant with no options. Switch most valid cases to bare strings so the tests exercise the default user path. Keep one `options: [true]` and one `options: [false]` as sentinels documenting that the explicit boolean forms still work.
1 parent 34225ac commit eaeb791

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

tests/lib/rules/template-require-form-method.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,21 @@ const validHbs = [
99
options: [{ allowedMethods: ['get'] }],
1010
code: '<form method="GET"></form>',
1111
},
12+
// No options → default-enabled with POST,GET,DIALOG.
13+
'<form method="POST"></form>',
14+
'<form method="post"></form>',
15+
'<form method="GET"></form>',
16+
'<form method="get"></form>',
17+
'<form method="DIALOG"></form>',
18+
'<form method="dialog"></form>',
19+
'<form method="{{formMethod}}"></form>',
20+
'<form method={{formMethod}}></form>',
21+
'<div/>',
22+
'<div></div>',
23+
'<div method="randomType"></div>',
24+
// Explicit `true` behaves identically to no options.
1225
{ options: [true], code: '<form method="POST"></form>' },
13-
{ options: [true], code: '<form method="post"></form>' },
14-
{ options: [true], code: '<form method="GET"></form>' },
15-
{ options: [true], code: '<form method="get"></form>' },
16-
{ options: [true], code: '<form method="DIALOG"></form>' },
17-
{ options: [true], code: '<form method="dialog"></form>' },
18-
{ options: [true], code: '<form method="{{formMethod}}"></form>' },
19-
{ options: [true], code: '<form method={{formMethod}}></form>' },
20-
{ options: [true], code: '<div/>' },
21-
{ options: [true], code: '<div></div>' },
22-
{ options: [true], code: '<div method="randomType"></div>' },
26+
// Explicit `false` disables the rule.
2327
{ options: [false], code: '<form></form>' },
2428
];
2529

0 commit comments

Comments
 (0)