Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion e2e/specs/admin/requests_operations_smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,17 @@ for (const language of ['en', 'cs'] as const) {
const box = await check.boundingBox();
expect(box!.y).toBeGreaterThan(summaryBox!.y + summaryBox!.height);
}
if (page.viewportSize()!.width >= 1024) {
const ipBox = await page.getByTestId('admin.requests.detail.risk.ip').boundingBox();
const mailBox = await page.getByTestId('admin.requests.detail.risk.mail').boundingBox();
expect(Math.abs(ipBox!.y - mailBox!.y)).toBeLessThan(1);
expect(mailBox!.x).toBeGreaterThan(ipBox!.x);
}
for (const kind of ['ip', 'mail']) {
await expect(page.getByTestId(`admin.requests.detail.risk.${kind}.details`)).not.toHaveAttribute('open');
}
await page.evaluate(() => window.scrollTo(0, 0));
await page.screenshot({ path: testInfo.outputPath('request-default-layout.png'), fullPage: true });
for (const kind of ['ip', 'mail']) {
await page.getByTestId(`admin.requests.detail.risk.${kind}.details`).locator('summary').click();
}
Expand Down Expand Up @@ -561,7 +572,7 @@ test('@workflow-matrix @pr-smoke @pr-smoke-mobile @smoke admin requests: automat
await expect.poll(osm.requestCount).toBe(2);
});

test('@workflow-matrix @pr-smoke @smoke admin requests: automatic address map distinguishes an unknown address', async ({ page }) => {
test('@workflow-matrix @pr-smoke @smoke admin requests: automatic address map distinguishes an unknown address', async ({ page }, testInfo) => {
await bootstrapVpsAdminWindow(page);
const osm = await installOsmMapMock(page, { empty: true });

Expand All @@ -579,6 +590,8 @@ test('@workflow-matrix @pr-smoke @smoke admin requests: automatic address map di
await expect(mapCard.getByTestId('admin.requests.detail.registration.address.map.retry')).toHaveCount(0);
await expect(mapCard.getByTestId('admin.requests.detail.registration.address.map.preview')).toHaveCount(0);
await expect.poll(osm.requestCount).toBe(1);
await page.evaluate(() => window.scrollTo(0, 0));
await page.screenshot({ path: testInfo.outputPath('request-unknown-address.png'), fullPage: true });
});

test('@workflow-matrix @smoke admin requests: rejected action error is visible', async ({ page }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/app/admin/RequestAddressMapLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function RequestAddressMapLink(props: { address: unknown; testId?: string
/>
) : (
<div
className="flex min-h-24 flex-col items-center justify-center gap-2 bg-surface-1 px-4 py-3 text-center text-xs text-muted"
className="flex flex-wrap items-center gap-2 bg-surface-1 px-3 py-2 text-xs text-muted"
aria-busy={loading}
aria-live="polite"
>
Expand Down
5 changes: 4 additions & 1 deletion src/pages/app/admin/RequestDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function RegistrationDetails(props: { request: RegistrationRequest }) {
const request = props.request;

return (
<dl className="grid grid-cols-1 gap-4 md:grid-cols-2" data-testid="admin.requests.detail.registration.fields">
<dl className="grid grid-cols-1 gap-x-4 gap-y-3 md:grid-cols-2" data-testid="admin.requests.detail.registration.fields">
<DetailField label={t('requests.field.login')} value={request.login} />
<DetailField label={t('requests.field.full_name')} value={request.full_name} />
<DetailField label={t('requests.field.org')} value={request.org_name} />
Expand Down Expand Up @@ -448,6 +448,9 @@ export function RequestDetailPage() {
</CardBody>
</Card>

</section>

<section className={reqType === 'registration' ? 'min-w-0 space-y-3 lg:col-span-3' : 'min-w-0 space-y-3 lg:col-span-2'}>
{reqType === 'registration' ? <RequestFraudChecks request={request as RegistrationRequest} /> : null}

<Card testId="admin.requests.detail.metadata">
Expand Down
8 changes: 4 additions & 4 deletions src/pages/app/admin/RequestFraudChecks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ function CheckCard(props: {
>
<CardHeader
title={props.title}
actions={(
<>
subtitle={(
<span className="mt-2 flex flex-wrap gap-2">
<Badge
variant={resultVariant}
className="text-sm font-semibold"
Expand All @@ -154,7 +154,7 @@ function CheckCard(props: {
>
{t(`requests.detail.risk.status.${props.status}`)}
</Badge>
</>
</span>
)}
/>
<CardBody className="space-y-3">
Expand Down Expand Up @@ -240,7 +240,7 @@ export function RequestFraudChecks(props: { request: RegistrationRequest }) {
</Badge>
) : null}
</div>
<div className="grid grid-cols-1 gap-3 xl:grid-cols-2">
<div className="grid grid-cols-1 gap-3 md:grid-cols-2">
<CheckCard
request={props.request}
kind="ip"
Expand Down
Loading