feat: add internal alpha frontend shell
This commit is contained in:
1 parent
eeb3c7634e
commit
b741fd799b
10 files changed
+1982
-15
No files matched your search
@@ -149,7 +149,7 @@ echo "Checking the unauthenticated login gate..."
|
||||
setup_status="$(curl --fail --silent "${base_url}/api/auth/setup-status")"
|
||||
[[ "${setup_status}" == *'"setup_required":true'* ]]
|
||||
[[ "$(status_for "" GET /login)" == "200" ]]
|
||||
for path in dashboard repairs locations system-health accounts; do
|
||||
for path in dashboard repairs locations system-health accounts monitoring/map operations/repairs assets/miners; do
|
||||
[[ "$(status_for "" GET "/${path}")" == "303" ]]
|
||||
done
|
||||
[[ "$(status_for "" GET /api/scanner/status)" == "401" ]]
|
||||
@@ -162,6 +162,11 @@ setup_response="$(curl --fail --silent -c "${admin_cookie}" \
|
||||
[[ "${setup_response}" == *'"role":"Admin"'* ]]
|
||||
[[ "$(status_for "${admin_cookie}" GET /dashboard)" == "200" ]]
|
||||
[[ "$(status_for "${admin_cookie}" GET /accounts)" == "200" ]]
|
||||
for path in monitoring/map operations/repairs assets/miners; do
|
||||
[[ "$(status_for "${admin_cookie}" GET "/${path}")" == "200" ]]
|
||||
done
|
||||
[[ "$(status_for "" GET /assets/minerops-app.css)" == "200" ]]
|
||||
[[ "$(status_for "" GET /assets/minerops-app.js)" == "200" ]]
|
||||
|
||||
for account in \
|
||||
'manager|Operations Manager|Manager|manager@example.com' \
|
||||
@@ -196,6 +201,9 @@ for login in \
|
||||
"${base_url}/api/auth/login")"
|
||||
[[ "${login_response}" == *"\"role\":\"${role}\""* ]]
|
||||
[[ "$(status_for "${cookie_jar}" GET /dashboard)" == "200" ]]
|
||||
[[ "$(status_for "${cookie_jar}" GET /monitoring/map)" == "200" ]]
|
||||
[[ "$(status_for "${cookie_jar}" GET /operations/repairs)" == "200" ]]
|
||||
[[ "$(status_for "${cookie_jar}" GET /assets/miners)" == "200" ]]
|
||||
done
|
||||
|
||||
[[ "$(status_for "${manager_cookie}" GET /system-health)" == "200" ]]
|
||||
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
cd "${repo_root}"
|
||||
|
||||
project_name="${MINEROPS_FRONTEND_TEST_PROJECT:-minerops-frontend-shell-$$}"
|
||||
compose=(
|
||||
docker compose
|
||||
--project-name "${project_name}"
|
||||
--env-file .env.dev
|
||||
-f compose.dev.yaml
|
||||
)
|
||||
|
||||
cleanup() {
|
||||
status=$?
|
||||
"${compose[@]}" down --volumes --remove-orphans >/dev/null 2>&1 || true
|
||||
exit "${status}"
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
if [[ ! -f .env.dev ]]; then
|
||||
echo "Missing .env.dev. Run ./scripts/dev-env-init.sh first." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Building frontend test image..."
|
||||
"${compose[@]}" build backend
|
||||
|
||||
echo "Running focused frontend shell tests..."
|
||||
"${compose[@]}" run --rm --no-deps -v "${repo_root}/backend/tests:/app/tests:ro" backend python -m unittest -v tests.test_frontend_shell
|
||||
|
||||
echo "Frontend shell tests passed."
|
||||
Reference in new issue
Block a user