12 lines
789 B
PowerShell
12 lines
789 B
PowerShell
$ErrorActionPreference = 'Stop'
|
|
$root = Split-Path -Parent $PSScriptRoot
|
|
$page = Get-Content -LiteralPath (Join-Path $root 'pages/genealogy/g01-my-genealogies.vue') -Raw -Encoding UTF8
|
|
$mock = Get-Content -LiteralPath (Join-Path $root 'data/mock.js') -Raw -Encoding UTF8
|
|
foreach ($token in @('genealogyContext', 'setCurrentGenealogyId', 'getCurrentGenealogyId', 'item.membership === "created"', 'item.membership === "joined"', 'genealogyId=${currentGenealogy.value.id}')) {
|
|
if (-not $page.Contains($token)) { throw "G01 context contract missing: $token" }
|
|
}
|
|
foreach ($membership in @("membership: 'created'", "membership: 'joined'")) {
|
|
if (-not $mock.Contains($membership)) { throw "Genealogy mock ownership missing: $membership" }
|
|
}
|
|
Write-Output 'G01-GENEALOGY-CONTEXT-CONTRACT PASS'
|