test: add e2e tests for comments, file tree, actions and branch protection (#40313)

Add e2e tests for flows that had no browser coverage: editing and
quote-replying an issue with an uploaded image, file tree and go-to-file
navigation, the Actions run view and workflow dispatch, and branch
protection rules with their priority.

The tests exposed bugs that are fixed here:

- Quote reply into an empty comment box left the Comment button disabled
- Removing an uploaded attachment did not update the comment buttons
- Going back from a file opened via the file tree to the initially
loaded page kept showing the other file

Assisted-by: Claude Code:claude-opus-5-5
This commit is contained in:
silverwind authored and GitHub committed 2026-11-12 07:12:55 +00:00
1 parent c4fb82858e
commit 9f93e8d808
10 files changed
+174 -19

No files matched your search

+3 -1
View File
@@ -1,6 +1,6 @@
import {reactive} from 'vue';
import {GET} from '../modules/fetch.ts';
import {pathEscapeSegments} from '../utils/url.ts';
import {pathEscapeSegments, pathWithQuery} from '../utils/url.ts';
import {createElementFromHTML} from '../utils/dom.ts';
import {html} from '../utils/html.ts';
@@ -18,6 +18,7 @@ export function createViewFileTreeStore(props: {repoLink: string, treePath: stri
const store = reactive({
rootFiles: [] as Array<FileTreeItem>,
selectedItem: props.treePath,
viewContentUrl: pathWithQuery(window.location),
async loadChildren(treePath: string, subPath: string = '') {
// there is no git ref if no commits were made yet (an empty repo)
@@ -39,6 +40,7 @@ export function createViewFileTreeStore(props: {repoLink: string, treePath: stri
async loadViewContent(url: string) {
const u = new URL(url, window.origin);
store.viewContentUrl = pathWithQuery(u);
u.searchParams.set('only_content', 'true');
const response = await GET(u.href);
const elViewContent = document.querySelector('.repo-view-content')!;