#!/bin/sh

set -eu

echo "Testing Alpha dashboard load..."

if nvim --headless \
  +'lua require("alpha").setup(require("alpha.themes.dashboard").config)' \
  +'qa!'; then
  echo "OK Alpha loaded without errors"
else
  echo "ERROR Alpha failed to load"
  exit 1
fi

echo "Testing if :help alpha exists..."

if nvim --headless \
  +"silent! help alpha" \
  +"if &buftype ==# 'help' | qa! | else | cquit 1 | endif"; then
  echo "OK :help alpha exists"
else
  echo "ERROR :help alpha not found"
  exit 1
fi
