实现 Makelore 一键提交审核

需求:让非专业用户在项目操作区一次提交,运营审核通过后直接发布。

实现:由 Electron Main 完成安全打包、自动版本、幂等重试和状态脱敏;补齐友好失败反馈、唯一提交入口及隔离 Electron E2E fixture。
This commit is contained in:
2026-08-08 14:44:08 +08:00
parent 7b23cce67a
commit 724290e864
18 changed files with 3056 additions and 31 deletions

View File

@@ -52,6 +52,8 @@ test.describe('Russian language localization', () => {
test('Russian language persists after skipping setup', async ({ launchElectronApp }) => {
const app = await launchElectronApp();
let relaunchedApp: Awaited<ReturnType<typeof launchElectronApp>> | null = null;
let firstAppClosed = false;
try {
const page = await getStableWindow(app);
@@ -64,17 +66,27 @@ test.describe('Russian language localization', () => {
// Skip setup
await page.getByTestId('setup-skip-button').click();
await expect(page.getByTestId('main-layout')).toBeVisible();
await expect(page.getByRole('button', { name: 'Continue in browser' })).toBeVisible();
// Navigate to Settings to verify language persistence
await openSettingsFromSidebarAccountMenu(page);
await expect(page.getByTestId('settings-page')).toBeVisible();
await closeElectronApp(app);
firstAppClosed = true;
relaunchedApp = await launchElectronApp({ skipSetup: true });
const relaunchedPage = await getStableWindow(relaunchedApp);
await expect(relaunchedPage.getByTestId('main-layout')).toBeVisible();
// Bypass authentication only for the relaunch so the persisted setting
// can be verified without weakening the production login gate.
await openSettingsFromSidebarAccountMenu(relaunchedPage);
await expect(relaunchedPage).toHaveURL(/\/settings$/);
await expect(relaunchedPage.getByRole('heading', { name: 'Настройки', exact: true })).toBeVisible();
// Verify sidebar shows Russian text (not English)
// "Настройки" is Russian-only, English is "Settings"
await expectSidebarSettingsLabel(page, 'Настройки');
await expectSidebarSettingsLabel(relaunchedPage, 'Настройки');
} finally {
await closeElectronApp(app);
if (relaunchedApp) await closeElectronApp(relaunchedApp);
if (!firstAppClosed) await closeElectronApp(app);
}
});
@@ -88,11 +100,11 @@ test.describe('Russian language localization', () => {
// Navigate to Settings (in English by default after skipSetup)
await openSettingsFromSidebarAccountMenu(page);
await expect(page.getByTestId('settings-page')).toBeVisible();
await expect(page).toHaveURL(/\/settings$/);
// Click Russian language button
const russianButton = page.locator('button', { hasText: 'Русский' });
await russianButton.click();
// Select Russian from the current settings control.
await page.locator('#language').selectOption('ru');
await expect(page.getByRole('heading', { name: 'Настройки', exact: true })).toBeVisible();
// Verify sidebar switched to Russian
// "Настройки" is Russian-only, English is "Settings"