Skip to content

test(html-button-has-type): make tests more strict #2831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 58 additions & 16 deletions tests/lib/rules/html-button-has-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ ruleTester.run('html-button-has-type', rule, {
errors: [
{
message: 'Missing an explicit type attribute for button.',
column: 11
column: 11,
line: 1,
endLine: 1,
endColumn: 19
}
]
},
Expand All @@ -68,7 +71,10 @@ ruleTester.run('html-button-has-type', rule, {
errors: [
{
message: 'A value must be set for button type attribute.',
column: 24
column: 24,
line: 1,
endLine: 1,
endColumn: 26
}
]
},
Expand All @@ -78,7 +84,10 @@ ruleTester.run('html-button-has-type', rule, {
errors: [
{
message: 'A value must be set for button type attribute.',
column: 19
column: 19,
line: 1,
endLine: 1,
endColumn: 23
}
]
},
Expand All @@ -88,7 +97,10 @@ ruleTester.run('html-button-has-type', rule, {
errors: [
{
message: 'foo is an invalid value for button type attribute.',
column: 24
column: 24,
line: 1,
endLine: 1,
endColumn: 29
}
]
},
Expand All @@ -99,7 +111,10 @@ ruleTester.run('html-button-has-type', rule, {
errors: [
{
message: 'button is a forbidden value for button type attribute.',
column: 24
column: 24,
line: 1,
endLine: 1,
endColumn: 32
}
]
},
Expand All @@ -110,7 +125,10 @@ ruleTester.run('html-button-has-type', rule, {
errors: [
{
message: 'submit is a forbidden value for button type attribute.',
column: 24
column: 24,
line: 1,
endLine: 1,
endColumn: 32
}
]
},
Expand All @@ -121,7 +139,10 @@ ruleTester.run('html-button-has-type', rule, {
errors: [
{
message: 'reset is a forbidden value for button type attribute.',
column: 24
column: 24,
line: 1,
endLine: 1,
endColumn: 31
}
]
},
Expand All @@ -137,17 +158,23 @@ ruleTester.run('html-button-has-type', rule, {
{
message: 'button is a forbidden value for button type attribute.',
line: 2,
column: 30
column: 30,
endLine: 2,
endColumn: 38
},
{
message: 'submit is a forbidden value for button type attribute.',
line: 3,
column: 30
column: 30,
endLine: 3,
endColumn: 38
},
{
message: 'reset is a forbidden value for button type attribute.',
line: 4,
column: 30
column: 30,
endLine: 4,
endColumn: 37
}
]
},
Expand All @@ -165,17 +192,23 @@ ruleTester.run('html-button-has-type', rule, {
{
message: 'reset is a forbidden value for button type attribute.',
line: 4,
column: 30
column: 30,
endLine: 4,
endColumn: 37
},
{
message: 'A value must be set for button type attribute.',
line: 5,
column: 30
column: 30,
endLine: 5,
endColumn: 32
},
{
message: 'foo is an invalid value for button type attribute.',
line: 6,
column: 30
column: 30,
endLine: 6,
endColumn: 35
}
]
},
Expand All @@ -185,11 +218,17 @@ ruleTester.run('html-button-has-type', rule, {
errors: [
{
message: 'Missing an explicit type attribute for button.',
column: 11
column: 11,
line: 1,
endLine: 1,
endColumn: 19
},
{
message: 'Missing an explicit type attribute for button.',
column: 39
column: 39,
line: 1,
endLine: 1,
endColumn: 47
}
]
},
Expand All @@ -199,7 +238,10 @@ ruleTester.run('html-button-has-type', rule, {
errors: [
{
message: 'A value must be set for button type attribute.',
column: 25
column: 25,
line: 1,
endLine: 1,
endColumn: 27
}
]
}
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy