Skip to content

Commit

Permalink
For loop lint
Browse files Browse the repository at this point in the history
Signed-off-by: Zabil Cheriya Maliackal <[email protected]>
  • Loading branch information
zabil committed Aug 29, 2024
1 parent 0f9a5e3 commit 10813da
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
10 changes: 5 additions & 5 deletions test/unit-tests/radioButton.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ describe(test_name, () => {
before(async () => {
const innerHtml =
`<script>
class ShadowButton extends HTMLElement {
constructor() {
super();
var shadow = this.attachShadow({mode: 'open'});
var button = document.createElement('input');
button.setAttribute('type', 'radio');
button.setAttribute('id', 'Shadow Click');
Expand All @@ -45,7 +45,7 @@ describe(test_name, () => {
hiddenButton.setAttribute('id', 'HiddenShadowButton');
hiddenButton.setAttribute('style','display:none');
shadow.appendChild(hiddenButton);
}
}
customElements.define('shadow-button', ShadowButton);
Expand Down Expand Up @@ -166,9 +166,9 @@ describe(test_name, () => {
await evaluate(() => {
document.raisedEvents = [];
const dropDown = document.getElementById("radioButtonWithLabelFor");
["input", "change", "click"].forEach((ev) => {
for (const ev of ["input", "change", "click"]) {
dropDown.addEventListener(ev, () => document.raisedEvents.push(ev));
});
}
});
await radioButton("radioButtonWithLabelFor").select();
const events = await evaluate(() => document.raisedEvents);
Expand Down
15 changes: 8 additions & 7 deletions test/unit-tests/textBox.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ describe(test_name, () => {
before(async () => {
const innerHtml =
` <script>
class ShadowButton extends HTMLElement {
constructor() {
super();
var shadow = this.attachShadow({mode: 'open'});
var button = document.createElement('textarea');
button.setAttribute('id', 'Shadow text');
button.textContent = "Shadow text"
shadow.appendChild(button);
}
}
customElements.define('shadow-button', ShadowButton);
Expand Down Expand Up @@ -426,6 +426,7 @@ describe(test_name, () => {

const inputTypesToTest = inputTypes.concat(inputTypesCaseSensitive);

// biome-ignore lint/complexity/noForEach: Test shorthand
inputTypesToTest.forEach((inputType) => {
describe(`input with type ${inputType.type}`, () => {
let filePath;
Expand Down Expand Up @@ -773,7 +774,7 @@ describe(test_name, () => {
<!DOCTYPE html>
<html>
<body>
<input type="search" id="mySearch" placeholder="Filter items">
</body>
</html>
Expand Down Expand Up @@ -801,17 +802,17 @@ describe(test_name, () => {
let filePath;
before(async () => {
const innerHtml = ` <script>
class ShadowButton extends HTMLElement {
constructor() {
super();
var shadow = this.attachShadow({mode: 'open'});
var button = document.createElement('input');
button.setAttribute('id', 'Shadow text');
button.setAttribute('placeholder', 'Shadow Placeholder');
shadow.appendChild(button);
}
}
customElements.define('shadow-button', ShadowButton);
Expand Down
1 change: 1 addition & 0 deletions test/unit-tests/timeField.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ describe(test_name, () => {
},
];

// biome-ignore lint/complexity/noForEach: Test shorhand
inputTypes.forEach((inputType) => {
describe(`input with type ${inputType.type}`, () => {
let filePath;
Expand Down

0 comments on commit 10813da

Please sign in to comment.