feat: add comprehensive Pester and standalone E2E test suite (96 tests) and code audit report
This commit is contained in:
+30
-13
@@ -108,6 +108,14 @@ function Update-ModeBadgeUI {
|
||||
$badgeMode.Background = [System.Windows.Media.BrushConverter]::new().ConvertFromString("#6366F1")
|
||||
}
|
||||
}
|
||||
|
||||
if ($txtGlobalStatus) {
|
||||
$txtGlobalStatus.Text = if ($isLive) { "시스템 온라인 (연결됨)" } else { "모의 테스트 환경 (정상)" }
|
||||
}
|
||||
if ($dotGlobalStatus) {
|
||||
$dotColor = if ($isLive) { "#10B981" } else { "#6366F1" }
|
||||
$dotGlobalStatus.Background = [System.Windows.Media.BrushConverter]::new().ConvertFromString($dotColor)
|
||||
}
|
||||
}
|
||||
|
||||
Update-ModeBadgeUI
|
||||
@@ -270,7 +278,8 @@ $script:loadSettingsToUI = {
|
||||
function Show-UserResolverDialog {
|
||||
param(
|
||||
[string]$InitialText = "",
|
||||
[System.Windows.Window]$Owner = $null
|
||||
[System.Windows.Window]$Owner = $null,
|
||||
[switch]$AutoConfirm
|
||||
)
|
||||
|
||||
$dialogPath = Join-Path $ScriptDir "Views\UserResolverDialog.xaml"
|
||||
@@ -307,7 +316,7 @@ function Show-UserResolverDialog {
|
||||
$notFound = @($results | Where-Object { $_.CandidateCount -eq 0 }).Count
|
||||
|
||||
if ($txtSummary) {
|
||||
$txtSummary.Text = "정상 매칭: $normCount건 | 동명이인: $ambCount건 | 미발견: $notFound건"
|
||||
$txtSummary.Text = "정상 매칭: $($normCount)건 | 동명이인: $($ambCount)건 | 미발견: $($notFound)건"
|
||||
}
|
||||
if ($badge) {
|
||||
if ($ambCount -gt 0) {
|
||||
@@ -329,7 +338,9 @@ function Show-UserResolverDialog {
|
||||
$txtInput.Text = $clip
|
||||
& $script:runResolutionDialog
|
||||
}
|
||||
} catch {}
|
||||
} catch {
|
||||
Write-Verbose "클립보드 접근 실패 또는 비어있음: $($_.Exception.Message)"
|
||||
}
|
||||
})
|
||||
}
|
||||
if ($btnClear) { $btnClear.add_Click({ $txtInput.Text = "" }) }
|
||||
@@ -392,6 +403,21 @@ function Show-UserResolverDialog {
|
||||
# Initial Run
|
||||
& $script:runResolutionDialog
|
||||
|
||||
if ($AutoConfirm) {
|
||||
$dialog.add_Loaded({
|
||||
if ($grid.ItemsSource) {
|
||||
foreach ($item in $grid.ItemsSource) {
|
||||
$item.IsSelected = ($item.IsResolved -and (-not $item.IsAmbiguous))
|
||||
}
|
||||
}
|
||||
$script:ResolvedUsersFromDialog = if ($grid.ItemsSource) {
|
||||
@($grid.ItemsSource | Where-Object { $_.IsSelected -and $_.SamAccountName -ne "-" })
|
||||
} else { @() }
|
||||
$dialog.DialogResult = $true
|
||||
$dialog.Close()
|
||||
})
|
||||
}
|
||||
|
||||
$ret = $dialog.ShowDialog()
|
||||
if ($ret -eq $true) {
|
||||
return $script:ResolvedUsersFromDialog
|
||||
@@ -450,12 +476,6 @@ function Navigate-ToPage {
|
||||
$btnUnlock = $view.FindName("BtnAdUnlock")
|
||||
$btnResetPwd = $view.FindName("BtnAdResetPwd")
|
||||
$btnToggleEnable = $view.FindName("BtnAdToggleEnable")
|
||||
|
||||
$txtDetailName = $view.FindName("TxtDetailName")
|
||||
$txtDetailEmail = $view.FindName("TxtDetailEmail")
|
||||
$txtDetailOu = $view.FindName("TxtDetailOu")
|
||||
$txtPropStatus = $view.FindName("TxtPropStatus")
|
||||
$listGroups = $view.FindName("ListMemberGroups")
|
||||
|
||||
if ($btnSearch) { $btnSearch.add_Click({ & $script:reloadAd }) }
|
||||
if ($btnRefresh) { $btnRefresh.add_Click({ & $script:reloadAd }) }
|
||||
@@ -731,7 +751,6 @@ function Navigate-ToPage {
|
||||
|
||||
$cmbShare = $view.FindName("CmbWsShare")
|
||||
$radAdd = $view.FindName("RadActionAdd")
|
||||
$radRemove = $view.FindName("RadActionRemove")
|
||||
$chkSyncAd = $view.FindName("ChkWsSyncAdGroup")
|
||||
|
||||
# Multi-DC Sync Controls
|
||||
@@ -742,13 +761,11 @@ function Navigate-ToPage {
|
||||
|
||||
$chkQuota = $view.FindName("ChkWsEnableQuota")
|
||||
$txtQtree = $view.FindName("TxtWsTargetQtree")
|
||||
$cmbQuotaUnit = $view.FindName("CmbWsQuotaUnit")
|
||||
$txtSoft = $view.FindName("TxtWsSoftLimit")
|
||||
$txtHard = $view.FindName("TxtWsHardLimit")
|
||||
|
||||
$txtReason = $view.FindName("TxtWsReason")
|
||||
$txtTicket = $view.FindName("TxtWsTicketNo")
|
||||
$txtExpire = $view.FindName("TxtWsExpireDate")
|
||||
|
||||
$btnDryRun = $view.FindName("BtnRunDryRun")
|
||||
$btnApply = $view.FindName("BtnApplyBatch")
|
||||
@@ -784,7 +801,7 @@ function Navigate-ToPage {
|
||||
$res = Resolve-UsersWithAmbiguityCheck -Tokens $tokens -Config $global:AppConfig
|
||||
$amb = @($res | Where-Object { $_.IsAmbiguous }).Count
|
||||
if ($amb -gt 0) {
|
||||
[System.Windows.MessageBox]::Show("입력된 사용자 중 동명이인이 $amb건 발견되었습니다.`n[동명이인 검증기]를 열어 정확한 대상을 확정하십시오.", "동명이인 감지", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||
[System.Windows.MessageBox]::Show("입력된 사용자 중 동명이인이 $($amb)건 발견되었습니다.`n[동명이인 검증기]를 열어 정확한 대상을 확정하십시오.", "동명이인 감지", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning)
|
||||
} else {
|
||||
[System.Windows.MessageBox]::Show("총 $($tokens.Count)건 중 $($res.Count)건의 계정이 정상 확인되었습니다.", "계정 확인 완료", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Information)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user