27 lines
1.1 KiB
PowerShell
27 lines
1.1 KiB
PowerShell
$projectRoot = Split-Path -Parent $PSScriptRoot
|
|
$mockupPath = Join-Path $projectRoot 'public\perspektivwerk\index.html'
|
|
$htaccessPath = Join-Path $projectRoot 'public\.htaccess'
|
|
|
|
Describe 'Perspektivwerk static route' {
|
|
It 'contains the static mockup entry point' {
|
|
(Test-Path -LiteralPath $mockupPath) | Should Be $true
|
|
}
|
|
|
|
It 'embeds the appointment booking component with its public assets' {
|
|
$mockup = Get-Content -LiteralPath $mockupPath -Raw
|
|
|
|
$mockup | Should Match 'href="/booking/booking\.css"'
|
|
$mockup | Should Match 'data-sufw-booking'
|
|
$mockup | Should Match 'src="/booking/booking\.js"'
|
|
}
|
|
|
|
It 'routes /perspektivwerk to the static entry point before the Contao fallback' {
|
|
$htaccess = Get-Content -LiteralPath $htaccessPath -Raw
|
|
$staticRouteIndex = $htaccess.IndexOf('RewriteRule ^perspektivwerk/?$ perspektivwerk/index.html [L]')
|
|
$fallbackIndex = $htaccess.IndexOf('RewriteRule ^ %{ENV:BASE}/index.php [L]')
|
|
|
|
$staticRouteIndex | Should BeGreaterThan -1
|
|
$staticRouteIndex | Should BeLessThan $fallbackIndex
|
|
}
|
|
}
|