fix(lint): Correct the issues

Sorry, my ESLint extension was disabled
This commit is contained in:
Ionys 2025-06-26 16:14:49 +02:00
parent 5198432cfc
commit 1e4bc5ddb5
4 changed files with 11 additions and 8 deletions

View file

@ -82,8 +82,8 @@
style="scale: 1.4; cursor: pointer;" style="scale: 1.4; cursor: pointer;"
type="checkbox" type="checkbox"
:disabled="saving" :disabled="saving"
@click="debounceCheckboxClick(() => { active = !active; save({ active }); })"
data-testid="active-checkbox" data-testid="active-checkbox"
@click="debounceCheckboxClick(() => { active = !active; save({ active }); })"
> >
<div class="ps-2">{{ $t("Active") }}</div> <div class="ps-2">{{ $t("Active") }}</div>
</label> </label>
@ -181,8 +181,8 @@ export default {
/** /**
* Save user changes * Save user changes
* @param {object} user user to save * @param {object} user user to save
* @param {string} [user.username] username used as login identifier. * @param {string} user.username username used as login identifier.
* @param {boolean} [user.active] is the user authorized to login? * @param {boolean} user.active is the user authorized to login?
* @returns {void} * @returns {void}
*/ */
save(user) { save(user) {

View file

@ -31,8 +31,8 @@
class="btn-ban-user btn ms-2 py-1" class="btn-ban-user btn ms-2 py-1"
:class="active ? 'btn-outline-danger' : 'btn-outline-success'" :class="active ? 'btn-outline-danger' : 'btn-outline-success'"
:disabled="processing" :disabled="processing"
@click.prevent="active ? disableConfirm(usersList[index]) : toggleActiveUser(usersList[index])"
:data-testid="`toggle-active-user-${username}`" :data-testid="`toggle-active-user-${username}`"
@click.prevent="active ? disableConfirm(usersList[index]) : toggleActiveUser(usersList[index])"
> >
<font-awesome-icon class="" :icon="active ? 'user-slash' : 'user-check'" /> <font-awesome-icon class="" :icon="active ? 'user-slash' : 'user-check'" />
</button> </button>

View file

@ -24,7 +24,7 @@ test.describe("Multiple Users", () => {
await page.getByTestId("password-input").fill("newuser123"); await page.getByTestId("password-input").fill("newuser123");
await page.getByTestId("password-repeat-input").fill("newuser123"); await page.getByTestId("password-repeat-input").fill("newuser123");
await page.getByTestId("submit-create-admin-form").click(); await page.getByTestId("submit-create-admin-form").click();
// Ensure the new user is created and visible in the user list // Ensure the new user is created and visible in the user list
await page.waitForURL("./settings/users"); await page.waitForURL("./settings/users");
await expect(page.getByTestId("users-list")).toContainText("newuser"); await expect(page.getByTestId("users-list")).toContainText("newuser");
@ -35,9 +35,12 @@ test.describe("Multiple Users", () => {
// Disable the admin user // Disable the admin user
await page.getByTestId("toggle-active-user-admin").click(); await page.getByTestId("toggle-active-user-admin").click();
// Click on the button containing Yes and having btn-danger class // Click on the button containing Yes and having btn-danger class
await page.getByRole("button", { name: "Yes", exact: true}).click(); await page.getByRole("button", {
name: "Yes",
exact: true
}).click();
await expect(page.getByText("You are not logged in.")).toBeVisible(); await expect(page.getByText("You are not logged in.")).toBeVisible();
// Make sure we're back on the login page after refresh // Make sure we're back on the login page after refresh
await page.reload(); await page.reload();
await expect(page.getByText("Log in")).toBeVisible(); await expect(page.getByText("Log in")).toBeVisible();

View file

@ -19,7 +19,7 @@ export async function screenshot(testInfo, page) {
/** /**
* @param {Page} page Page * @param {Page} page Page
* @param {string} [user="admin"] Username to log in with * @param {string} user Username to log in with
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
export async function login(page, user = "admin") { export async function login(page, user = "admin") {