Fix public home routing and add home smoke test
This commit is contained in:
@@ -6,7 +6,31 @@
|
||||
if (!firstRender)
|
||||
return;
|
||||
|
||||
var returnUrl = Uri.EscapeDataString(Navigation.ToBaseRelativePath(Navigation.Uri));
|
||||
var returnUrl = Uri.EscapeDataString(GetSafeReturnUrl());
|
||||
Navigation.NavigateTo($"/taxbaik/admin/login?returnUrl={returnUrl}", replace: true);
|
||||
}
|
||||
|
||||
private string GetSafeReturnUrl()
|
||||
{
|
||||
try
|
||||
{
|
||||
var current = new Uri(Navigation.Uri);
|
||||
var baseUri = new Uri(Navigation.BaseUri);
|
||||
|
||||
if (current.IsAbsoluteUri &&
|
||||
string.Equals(current.Scheme, baseUri.Scheme, StringComparison.OrdinalIgnoreCase) &&
|
||||
string.Equals(current.Authority, baseUri.Authority, StringComparison.OrdinalIgnoreCase) &&
|
||||
current.AbsolutePath.StartsWith(baseUri.AbsolutePath, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var relative = current.AbsolutePath[baseUri.AbsolutePath.Length..] + current.Query + current.Fragment;
|
||||
return string.IsNullOrWhiteSpace(relative) ? "dashboard" : relative.TrimStart('/');
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Fall through to a safe default.
|
||||
}
|
||||
|
||||
return "dashboard";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -476,8 +476,9 @@ app.MapHealthChecks("/healthz");
|
||||
app.MapRazorPages(); // Sitemap.cshtml, Rss.cshtml, Feed.cshtml
|
||||
app.MapStaticAssets();
|
||||
|
||||
// Blazor WebAssembly - prerender 지원
|
||||
app.MapRazorComponents<TaxBaik.WasmClient.Components.Admin.App>()
|
||||
// Blazor WebAssembly - 관리자 앱은 /taxbaik/admin 아래에서만 렌더링
|
||||
app.MapGroup("/taxbaik/admin")
|
||||
.MapRazorComponents<TaxBaik.WasmClient.Components.Admin.App>()
|
||||
.AddInteractiveWebAssemblyRenderMode()
|
||||
.AllowAnonymous();
|
||||
|
||||
|
||||
@@ -4,10 +4,12 @@ import { captureEvidence } from './helpers/evidence';
|
||||
const baseUrl = (process.env.E2E_BASE_URL ?? 'https://www.taxbaik.com/taxbaik').replace(/\/$/, '');
|
||||
|
||||
test.describe('public smoke', () => {
|
||||
test('@smoke loads the main public pages with SEO basics', async ({ page }) => {
|
||||
test('@smoke loads the home page and key public pages with SEO basics', async ({ page }) => {
|
||||
await page.goto(baseUrl);
|
||||
await expect(page).toHaveTitle(/백원숙 세무회계/);
|
||||
await expect(page).not.toHaveTitle(/관리자/);
|
||||
await expect(page.getByRole('heading', { name: /세금과 자산|백원숙 세무회계/ })).toBeVisible();
|
||||
await expect(page.getByRole('link', { name: /상담 신청|무료 상담 신청/ })).toBeVisible();
|
||||
await expect(page.locator('meta[name="description"]')).toHaveAttribute('content', /사업자 기장|부동산|종합소득세/);
|
||||
await expect(page.getByRole('heading', { name: /상담 과정/ })).toBeVisible();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user