Merge pull request 'fix: WIP toggle by reducing max issue title' (#5143) from fnetx/wip-toggle-workaround into forgejo
Some checks are pending
/ release (push) Waiting to run
testing / frontend-checks (push) Waiting to run
testing / backend-checks (push) Waiting to run
testing / test-unit (push) Blocked by required conditions
testing / test-remote-cacher (map[image:docker.io/bitnami/redis:7.2 port:6379]) (push) Blocked by required conditions
testing / test-remote-cacher (map[image:docker.io/bitnami/valkey:7.2 port:6379]) (push) Blocked by required conditions
testing / test-remote-cacher (map[image:ghcr.io/microsoft/garnet-alpine:1.0.14 port:6379]) (push) Blocked by required conditions
testing / test-remote-cacher (map[image:registry.redict.io/redict:7.3.0-scratch port:6379]) (push) Blocked by required conditions
testing / test-mysql (push) Blocked by required conditions
testing / test-pgsql (push) Blocked by required conditions
testing / test-sqlite (push) Blocked by required conditions
testing / security-check (push) Blocked by required conditions

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5143
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
Otto 2024-08-29 21:05:35 +00:00
commit 1004ecd56b
4 changed files with 20 additions and 3 deletions

View file

@ -46,10 +46,10 @@ export default {
locale: 'en-US', locale: 'en-US',
/* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
actionTimeout: 1000, actionTimeout: 2000,
/* Maximum time allowed for navigation, such as `page.goto()`. */ /* Maximum time allowed for navigation, such as `page.goto()`. */
navigationTimeout: 5 * 1000, navigationTimeout: 10 * 1000,
/* Base URL to use in actions like `await page.goto('/')`. */ /* Base URL to use in actions like `await page.goto('/')`. */
baseURL: BASE_URL, baseURL: BASE_URL,

View file

@ -22,7 +22,7 @@
{{if $canEditIssueTitle}} {{if $canEditIssueTitle}}
<div class="ui form issue-title tw-hidden" id="issue-title-editor"> <div class="ui form issue-title tw-hidden" id="issue-title-editor">
<div class="ui input tw-flex-1"> <div class="ui input tw-flex-1">
<input value="{{.Issue.Title}}" data-old-title="{{.Issue.Title}}" maxlength="255" autocomplete="off" class="js-quick-submit"> <input value="{{.Issue.Title}}" data-old-title="{{.Issue.Title}}" maxlength="245" autocomplete="off" class="js-quick-submit">
</div> </div>
<div class="button-row"> <div class="button-row">
<button class="ui small basic cancel button">{{ctx.Locale.Tr "repo.issues.cancel"}}</button> <button class="ui small basic cancel button">{{ctx.Locale.Tr "repo.issues.cancel"}}</button>

View file

@ -51,6 +51,22 @@ test('Pull: Toggle WIP', async ({browser}, workerInfo) => {
// remove again // remove again
await click_toggle_wip({page}); await click_toggle_wip({page});
await check_wip({page}, false); await check_wip({page}, false);
// check maximum title length is handled gracefully
const maxLenStr = prTitle + 'a'.repeat(240);
await page.locator('#issue-title-edit-show').click();
await page.locator('#issue-title-editor input').fill(maxLenStr);
await page.getByText('Save').click();
await page.waitForLoadState('networkidle');
await click_toggle_wip({page});
await check_wip({page}, true);
await click_toggle_wip({page});
await check_wip({page}, false);
await expect(page.locator('h1')).toContainText(maxLenStr);
// restore original title
await page.locator('#issue-title-edit-show').click();
await page.locator('#issue-title-editor input').fill(prTitle);
await page.getByText('Save').click();
await check_wip({page}, false);
}); });
test('Issue: Labels', async ({browser}, workerInfo) => { test('Issue: Labels', async ({browser}, workerInfo) => {

View file

@ -22,6 +22,7 @@ const LOGIN_PASSWORD = 'password';
// log in user and store session info. This should generally be // log in user and store session info. This should generally be
// run in test.beforeAll(), then the session can be loaded in tests. // run in test.beforeAll(), then the session can be loaded in tests.
export async function login_user(browser, workerInfo, user) { export async function login_user(browser, workerInfo, user) {
test.setTimeout(60000);
// Set up a new context // Set up a new context
const context = await test_context(browser); const context = await test_context(browser);
const page = await context.newPage(); const page = await context.newPage();