Something went wrong. Try again.
Something went wrong. Try again.
587 B · 19 lines
TypeScript
at main
1234567891011121314151617181920import { test } from '@japa/runner'import testUtils from '@adonisjs/core/services/test_utils'
test.group('Auth', (group) => { group.each.setup(() => testUtils.db().truncate())
test('renders login page for guests', async ({ client }) => { const response = await client.visit('login').withInertia()
response.assertStatus(200) response.assertInertiaComponent('auth/login') })
test('redirects unauthenticated users visiting /shelf to /login', async ({ client }) => { const response = await client.visit('shelf')
response.assertRedirectsTo('/login') })})