test: fix multi-tenant flakes (#12983)

This commit is contained in:
Jarrod Flesch
2025-06-30 17:18:41 -04:00
committed by GitHub
parent 0e8ac0bad5
commit c07187d804
3 changed files with 24 additions and 2 deletions

View File

@@ -187,7 +187,15 @@ export const TenantSelectionProviderClient = ({
// Users with no cookie set and only 1 tenant should set that tenant automatically
setTenant({ id: tenantOptionsFromProps[0]?.value, refresh: true })
setTenantOptions(tenantOptionsFromProps)
} else if ((!tenantOptions || tenantOptions.length === 0) && tenantOptionsFromProps) {
} else if (
(!tenantOptions || tenantOptions.length === 0) &&
tenantOptionsFromProps.length > 0
) {
// If there are no tenant options, set them from the props
setTenantOptions(tenantOptionsFromProps)
}
} else if (userID && tenantCookie) {
if ((!tenantOptions || tenantOptions.length === 0) && tenantOptionsFromProps.length > 0) {
// If there are no tenant options, set them from the props
setTenantOptions(tenantOptionsFromProps)
}