Add page middleware tests