Page MenuHomeDevCentral

D3992.diff
No OneTemporary

D3992.diff

diff --git a/frontend/src/App.vue b/frontend/src/App.vue
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -19,6 +19,10 @@
</template>
<style>
+html {
+ overflow-y: scroll;
+}
+
.fade-enter-active,
.fade-leave-active {
transition: opacity 0.2s ease;
diff --git a/frontend/src/views/IncidentHistory.vue b/frontend/src/views/IncidentHistory.vue
--- a/frontend/src/views/IncidentHistory.vue
+++ b/frontend/src/views/IncidentHistory.vue
@@ -94,7 +94,7 @@
</div>
<!-- Loading -->
- <div v-if="isLoading" class="flex justify-center py-20">
+ <div v-if="isLoading" class="flex justify-center py-20 min-h-[60vh]">
<div class="h-8 w-8 animate-spin rounded-full border-4 border-gray-200 border-t-brand-500"></div>
</div>
diff --git a/frontend/src/views/__tests__/App.test.js b/frontend/src/views/__tests__/App.test.js
new file mode 100644
--- /dev/null
+++ b/frontend/src/views/__tests__/App.test.js
@@ -0,0 +1,69 @@
+import { describe, it, expect, vi } from 'vitest'
+import { mount } from '@vue/test-utils'
+import { createRouter, createWebHistory } from 'vue-router'
+import App from '@/App.vue'
+
+vi.mock('@/plugins/api', () => ({
+ configApi: { getAll: vi.fn(() => Promise.resolve({ navbar: { title: 'ServPulse', buttons_left: [] } })) },
+ authApi: { verify: vi.fn() },
+}))
+
+vi.mock('@/composables/useAuth', () => ({
+ useAuth: () => ({
+ isAuthenticated: { value: false },
+ logout: vi.fn(),
+ }),
+}))
+
+vi.mock('@/composables/useDarkMode', () => ({
+ useDarkMode: () => ({
+ isDark: { value: false },
+ isToggleable: { value: true },
+ toggleDarkMode: vi.fn(),
+ }),
+}))
+
+function createTestRouter() {
+ return createRouter({
+ history: createWebHistory(),
+ routes: [
+ { path: '/', component: { template: '<div>Status</div>' } },
+ { path: '/incidents', component: { template: '<div>Incidents</div>' } },
+ { path: '/admin', component: { template: '<div>Admin</div>' } },
+ { path: '/admin/login', component: { template: '<div>Login</div>' } },
+ ],
+ })
+}
+
+describe('App route transitions', () => {
+ it('wraps RouterView in a Transition component', () => {
+ const router = createTestRouter()
+ const wrapper = mount(App, {
+ global: { plugins: [router] },
+ })
+
+ const transition = wrapper.findComponent({ name: 'Transition' })
+ expect(transition.exists()).toBe(true)
+ })
+
+ it('uses fade transition with out-in mode', () => {
+ const router = createTestRouter()
+ const wrapper = mount(App, {
+ global: { plugins: [router] },
+ })
+
+ const transition = wrapper.findComponent({ name: 'Transition' })
+ expect(transition.props('name')).toBe('fade')
+ expect(transition.props('mode')).toBe('out-in')
+ })
+
+ it('renders navbar and footer', () => {
+ const router = createTestRouter()
+ const wrapper = mount(App, {
+ global: { plugins: [router] },
+ })
+
+ expect(wrapper.findComponent({ name: 'AppNavbar' }).exists()).toBe(true)
+ expect(wrapper.findComponent({ name: 'AppFooter' }).exists()).toBe(true)
+ })
+})

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 5, 23:36 (22 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3500007
Default Alt Text
D3992.diff (3 KB)

Event Timeline