40 lines
1.5 KiB
PowerShell
40 lines
1.5 KiB
PowerShell
$projectRoot = Split-Path -Parent $PSScriptRoot
|
|
$seedPath = Join-Path $projectRoot 'database\contao-baseline.sql'
|
|
$exportScriptPath = Join-Path $projectRoot 'scripts\Export-ContaoBaseline.ps1'
|
|
$importScriptPath = Join-Path $projectRoot 'scripts\Import-ContaoBaseline.ps1'
|
|
|
|
Describe 'Contao baseline' {
|
|
$seed = Get-Content -LiteralPath $seedPath -Raw
|
|
|
|
It 'contains the page-specific PerspektivWerk background rule' {
|
|
$seed | Should Match 'body\.perspektivwerk-page \{ background-color: #159A34; \}'
|
|
}
|
|
|
|
It 'contains the versioned Contao website tables' {
|
|
foreach ($table in @('tl_theme', 'tl_layout', 'tl_page', 'tl_article', 'tl_content')) {
|
|
$seed | Should Match "INSERT INTO ``$table``"
|
|
}
|
|
}
|
|
|
|
It 'does not contain user, runtime or unversioned file metadata' {
|
|
$seed | Should Not Match 'INSERT INTO `tl_(user|session|log|lock|files)'
|
|
}
|
|
|
|
It 'uses the same approved table list in export and import scripts' {
|
|
$export = Get-Content -LiteralPath $exportScriptPath -Raw
|
|
$import = Get-Content -LiteralPath $importScriptPath -Raw
|
|
|
|
foreach ($table in @('tl_theme', 'tl_layout', 'tl_module', 'tl_page', 'tl_article', 'tl_content', 'tl_form', 'tl_form_field')) {
|
|
$export | Should Match $table
|
|
$import | Should Match $table
|
|
}
|
|
}
|
|
|
|
It 'asks before overwriting an existing baseline export' {
|
|
$export = Get-Content -LiteralPath $exportScriptPath -Raw
|
|
|
|
$export | Should Match 'Read-Host'
|
|
$export | Should Match 'überschreiben'
|
|
}
|
|
}
|