mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-14 15:00:25 +00:00
Adds a new button on the right side of the label's filter menu items to explicitly exclude labels. The new button is reachable with the keyboard by using the vertical arrow keys to reach the label you want to exclude and then the horizontal arrow keys to select the exclusion button. The new button will only be visible when hovering the menu item or reaching it with the keyboard. Adjusted the alignment of labels when at least one label is selected so that users can clearly discern which labels are selected or not. Resolves #3302 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10702 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: Luis <luis@adame.dev> Co-committed-by: Luis <luis@adame.dev>
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
// @watch start
|
|
// templates/shared/label_filter.tmpl
|
|
// web_src/js/features/repo-issue-sidebar-list.ts
|
|
// @watch end
|
|
|
|
import {expect} from '@playwright/test';
|
|
import {test} from './utils_e2e.ts';
|
|
|
|
test.use({user: 'user2'});
|
|
|
|
test('Label filter exclusion', async ({page}) => {
|
|
const response = await page.goto('/user2/repo1/issues');
|
|
expect(response?.status()).toBe(200);
|
|
|
|
await expect(
|
|
page.getByRole('link', {name: 'issue1'}),
|
|
).toBeVisible();
|
|
|
|
// open label filter dropdown
|
|
await page.getByRole('combobox').filter({has: page.getByText('Label')}).click();
|
|
|
|
// exclude the label1 label attached to issue1
|
|
const labelOption = page
|
|
.getByRole('option').filter({has: page.getByText('label1')});
|
|
await expect(labelOption).toBeVisible();
|
|
await labelOption.hover();
|
|
await labelOption.getByRole('button', {name: 'Exclude label'}).click();
|
|
|
|
await expect(
|
|
page.getByRole('link', {name: 'issue1'}),
|
|
).toBeHidden();
|
|
|
|
// open label filter dropdown
|
|
await page.getByRole('combobox').filter({has: page.getByText('Label')}).click();
|
|
|
|
// clear exclusion
|
|
await expect(labelOption).toBeVisible();
|
|
await labelOption.hover();
|
|
await labelOption.getByRole('button', {name: 'Clear exclusion'}).click();
|
|
|
|
await expect(
|
|
page.getByRole('link', {name: 'issue1'}),
|
|
).toBeVisible();
|
|
});
|