fix: sync G01 role shortcuts
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$page = Get-Content -Raw 'pages/genealogy/g01-my-genealogies.vue'
|
||||
|
||||
function Assert-Contains([string]$Content, [string]$Pattern, [string]$Message) {
|
||||
if (-not $Content.Contains($Pattern)) { throw $Message }
|
||||
}
|
||||
|
||||
Assert-Contains $page 'v-for="item in visibleShortcuts"' 'G01 must render the membership-filtered shortcut list'
|
||||
Assert-Contains $page '{{ currentRoleLabel }}' 'G01 must render the membership-derived role label'
|
||||
Assert-Contains $page 'currentGenealogy.value?.membership === "created"' 'G01 must derive owner state from membership'
|
||||
Assert-Contains $page 'item.key !== "applications"' 'G01 must remove application review for joined members'
|
||||
|
||||
Write-Output 'G01-ROLE-SHORTCUT-CONTRACT PASS'
|
||||
@@ -261,10 +261,30 @@ const run = async () => {
|
||||
await valueOf(send, "document.querySelectorAll('.switcher-item')[1].click()")
|
||||
await waitFor(send, "!document.querySelector('.genealogy-switcher')", 'Selecting the second genealogy did not close the switcher')
|
||||
assert((await valueOf(send, "document.querySelector('.current-slip')?.textContent"))?.includes('山东'), 'Selecting the second genealogy did not update the current genealogy')
|
||||
assert(
|
||||
(await valueOf(send, "document.querySelector('.current-meta')?.textContent"))?.includes('成员'),
|
||||
'Joined genealogy did not display the member role'
|
||||
)
|
||||
assert(
|
||||
(await valueOf(send, "document.querySelectorAll('.shortcut-item').length")) === 3,
|
||||
'Joined genealogy did not hide the application-review shortcut'
|
||||
)
|
||||
assert(
|
||||
!(await valueOf(send, "document.querySelector('.shortcut-grid')?.textContent"))?.includes('申请审核'),
|
||||
'Joined genealogy still exposed application review'
|
||||
)
|
||||
|
||||
await openSwitcher(send)
|
||||
await valueOf(send, "document.querySelectorAll('.switcher-item')[0].click()")
|
||||
await waitFor(send, "!document.querySelector('.genealogy-switcher')", 'Restoring the first genealogy did not close the switcher')
|
||||
assert(
|
||||
(await valueOf(send, "document.querySelector('.current-meta')?.textContent"))?.includes('管理员'),
|
||||
'Created genealogy did not restore the administrator role'
|
||||
)
|
||||
assert(
|
||||
(await valueOf(send, "document.querySelectorAll('.shortcut-item').length")) === 4,
|
||||
'Created genealogy did not restore all four shortcuts'
|
||||
)
|
||||
await openSwitcher(send)
|
||||
await clearClones(send)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user