feat(git): clarify dashboard release flow
This commit is contained in:
@@ -90,16 +90,44 @@ test.describe('Git Integration', () => {
|
||||
|
||||
test.describe('Git dashboard recovery browser states', () => {
|
||||
test('release screen separates a validated publication from unsaved dashboard edits', async ({ authPage }) => {
|
||||
await authPage.route('**/api/git/repositories/*/generate-message?*', async (route) => {
|
||||
const requestUrl = new URL(route.request().url());
|
||||
if (requestUrl.searchParams.get('purpose') !== 'summary') {
|
||||
await route.continue();
|
||||
return;
|
||||
}
|
||||
await route.fulfill({
|
||||
status: 200,
|
||||
contentType: 'application/json',
|
||||
body: JSON.stringify({
|
||||
summary: '- Изменено **название** дашборда.\n- Разрешён параметр `allow_dml`.',
|
||||
}),
|
||||
});
|
||||
});
|
||||
await authPage.goto(`${FRONTEND_URL}/git`);
|
||||
const dashboardRow = authPage.locator('tr').filter({ hasText: "World Bank's Data" }).first();
|
||||
await expect(dashboardRow).toBeVisible();
|
||||
await dashboardRow.getByRole('button', { name: /Управление Git|Manage Git/ }).click();
|
||||
|
||||
const dialog = authPage.getByRole('dialog', { name: /Управление Git|Git management/ });
|
||||
await expect(dialog.getByText(/Проверенная версия для пользователей|Validated version for users/)).toBeVisible();
|
||||
await expect(dialog.getByText(/Кандидат на публикацию|Publication candidate/)).toBeVisible();
|
||||
await expect(dialog.getByRole('button', { name: /Опубликовать проверенную версию|Publish validated version/ })).toBeVisible();
|
||||
await expect(dialog.getByText(/Есть несохранённые изменения|There are unsaved changes/)).toBeVisible();
|
||||
await expect(dialog.getByText(/в публикацию не войдут|will not be included in the current publication/)).toBeVisible();
|
||||
await expect(dialog).not.toContainText('.superset-tools-fingerprint');
|
||||
await expect(dialog).not.toContainText('metadata.yaml');
|
||||
|
||||
await dialog.getByRole('button', { name: /Перейти к сохранению|Go to saving/ }).click();
|
||||
await expect(dialog.locator('#git-commit-message')).toBeFocused();
|
||||
await expect(dialog.getByRole('button', { name: /^Сохранить версию$|^Save version$/ })).toBeVisible();
|
||||
await expect(dialog.getByText(/Ключевые изменения|Key changes/)).toBeVisible();
|
||||
const renderedSummary = dialog.getByTestId('workspace-summary-markdown');
|
||||
await expect(renderedSummary.locator('li')).toHaveCount(2);
|
||||
await expect(renderedSummary.locator('strong')).toHaveText('название');
|
||||
await expect(renderedSummary.locator('code')).toHaveText('allow_dml');
|
||||
await expect(renderedSummary).not.toContainText('**название**');
|
||||
const technicalDiff = dialog.getByText(/Технический YAML diff|Technical YAML diff/).locator('..');
|
||||
await expect(technicalDiff).not.toHaveAttribute('open', '');
|
||||
});
|
||||
|
||||
test('checkout conflict state exposes scoped recovery actions', async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user