mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-08 14:12:37 +02:00
fix(repo-shortcuts): Address maintainer review feedback for repo keyboard shortcuts
- Remove license headers from e2e test (not used in TypeScript files) - Remove waitForLoadState calls (Playwright waits implicitly) - Use getByPlaceholder selectors instead of CSS class selectors - Remove unnecessary z-index from shortcut hint styling
This commit is contained in:
1 parent
670be300f1
commit
ec3420a2c9
2 files changed
+6
-16
No files matched your search
@@ -1,6 +1,3 @@
|
|||||||
// Copyright 2026 The Gitea Authors. All rights reserved.
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
import {test, expect} from '@playwright/test';
|
import {test, expect} from '@playwright/test';
|
||||||
import {login_user, load_logged_in_context} from './utils_e2e.ts';
|
import {login_user, load_logged_in_context} from './utils_e2e.ts';
|
||||||
|
|
||||||
@@ -15,10 +12,9 @@ test.describe('Repository Keyboard Shortcuts', () => {
|
|||||||
|
|
||||||
// Navigate to a repository page with file listing
|
// Navigate to a repository page with file listing
|
||||||
await page.goto('/user2/repo1');
|
await page.goto('/user2/repo1');
|
||||||
await page.waitForLoadState('networkidle'); // eslint-disable-line playwright/no-networkidle
|
|
||||||
|
|
||||||
// Verify the file search input exists and has the keyboard hint
|
// Verify the file search input exists and has the keyboard hint
|
||||||
const fileSearchInput = page.locator('.repo-file-search-container input');
|
const fileSearchInput = page.getByPlaceholder('Go to file');
|
||||||
await expect(fileSearchInput).toBeVisible();
|
await expect(fileSearchInput).toBeVisible();
|
||||||
|
|
||||||
// Verify the keyboard hint is visible
|
// Verify the keyboard hint is visible
|
||||||
@@ -39,10 +35,9 @@ test.describe('Repository Keyboard Shortcuts', () => {
|
|||||||
|
|
||||||
// Navigate to a repository page
|
// Navigate to a repository page
|
||||||
await page.goto('/user2/repo1');
|
await page.goto('/user2/repo1');
|
||||||
await page.waitForLoadState('networkidle'); // eslint-disable-line playwright/no-networkidle
|
|
||||||
|
|
||||||
// Focus on file search first
|
// Focus on file search first
|
||||||
const fileSearchInput = page.locator('.repo-file-search-container input');
|
const fileSearchInput = page.getByPlaceholder('Go to file');
|
||||||
await fileSearchInput.click();
|
await fileSearchInput.click();
|
||||||
|
|
||||||
// Type something including 't'
|
// Type something including 't'
|
||||||
@@ -59,10 +54,9 @@ test.describe('Repository Keyboard Shortcuts', () => {
|
|||||||
|
|
||||||
// Navigate to repo home page where code search is available
|
// Navigate to repo home page where code search is available
|
||||||
await page.goto('/user2/repo1');
|
await page.goto('/user2/repo1');
|
||||||
await page.waitForLoadState('networkidle'); // eslint-disable-line playwright/no-networkidle
|
|
||||||
|
|
||||||
// The code search input is in the sidebar
|
// The code search input is in the sidebar
|
||||||
const codeSearchInput = page.locator('.code-search-input');
|
const codeSearchInput = page.getByPlaceholder('Search code…');
|
||||||
await expect(codeSearchInput).toBeVisible();
|
await expect(codeSearchInput).toBeVisible();
|
||||||
|
|
||||||
// Verify the keyboard hint is visible
|
// Verify the keyboard hint is visible
|
||||||
@@ -83,10 +77,9 @@ test.describe('Repository Keyboard Shortcuts', () => {
|
|||||||
|
|
||||||
// Navigate to a repository page
|
// Navigate to a repository page
|
||||||
await page.goto('/user2/repo1');
|
await page.goto('/user2/repo1');
|
||||||
await page.waitForLoadState('networkidle'); // eslint-disable-line playwright/no-networkidle
|
|
||||||
|
|
||||||
// Check file search kbd hint
|
// Check file search kbd hint
|
||||||
const fileSearchInput = page.locator('.repo-file-search-container input');
|
const fileSearchInput = page.getByPlaceholder('Go to file');
|
||||||
const fileKbdHint = page.locator('.repo-file-search-input-wrapper kbd');
|
const fileKbdHint = page.locator('.repo-file-search-input-wrapper kbd');
|
||||||
|
|
||||||
// Initially the hint should be visible
|
// Initially the hint should be visible
|
||||||
@@ -106,9 +99,8 @@ test.describe('Repository Keyboard Shortcuts', () => {
|
|||||||
|
|
||||||
// Navigate to a repository page
|
// Navigate to a repository page
|
||||||
await page.goto('/user2/repo1');
|
await page.goto('/user2/repo1');
|
||||||
await page.waitForLoadState('networkidle'); // eslint-disable-line playwright/no-networkidle
|
|
||||||
|
|
||||||
const codeSearchInput = page.locator('.code-search-input');
|
const codeSearchInput = page.getByPlaceholder('Search code…');
|
||||||
await expect(codeSearchInput).toBeVisible();
|
await expect(codeSearchInput).toBeVisible();
|
||||||
|
|
||||||
const codeKbdHint = page.locator('.repo-code-search-input-wrapper .repo-search-shortcut-hint');
|
const codeKbdHint = page.locator('.repo-code-search-input-wrapper .repo-search-shortcut-hint');
|
||||||
@@ -130,9 +122,8 @@ test.describe('Repository Keyboard Shortcuts', () => {
|
|||||||
|
|
||||||
// Navigate to a repository page
|
// Navigate to a repository page
|
||||||
await page.goto('/user2/repo1');
|
await page.goto('/user2/repo1');
|
||||||
await page.waitForLoadState('networkidle'); // eslint-disable-line playwright/no-networkidle
|
|
||||||
|
|
||||||
const fileSearchInput = page.locator('.repo-file-search-container input');
|
const fileSearchInput = page.getByPlaceholder('Go to file');
|
||||||
|
|
||||||
// Click somewhere else first to ensure nothing is focused
|
// Click somewhere else first to ensure nothing is focused
|
||||||
await page.locator('body').click();
|
await page.locator('body').click();
|
||||||
|
|||||||
@@ -2089,7 +2089,6 @@ tbody.commit-list {
|
|||||||
border-radius: var(--border-radius);
|
border-radius: var(--border-radius);
|
||||||
box-shadow: inset 0 -1px 0 var(--color-secondary);
|
box-shadow: inset 0 -1px 0 var(--color-secondary);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
z-index: 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Override Fomantic UI action input styles for file search - need high specificity */
|
/* Override Fomantic UI action input styles for file search - need high specificity */
|
||||||
|
|||||||
Reference in new issue
Block a user