feat(graph): add Federation Graph page and enhance coverage
Adds a new Federation Graph page to display subgraphs and their schemas. Implements loading state and error handling. Enhances coverage reporting by including 'lcov' format for better insights into test coverage metrics.
This commit is contained in:
+54
-10
@@ -2,16 +2,36 @@ import { config } from '@vue/test-utils'
|
||||
import { vi } from 'vitest'
|
||||
import * as Vue from 'vue'
|
||||
|
||||
// Mock localStorage
|
||||
const localStorageMock = {
|
||||
getItem: vi.fn(),
|
||||
setItem: vi.fn(),
|
||||
removeItem: vi.fn(),
|
||||
clear: vi.fn(),
|
||||
key: vi.fn(),
|
||||
length: 0,
|
||||
// Mock localStorage with actual implementation
|
||||
class LocalStorageMock {
|
||||
private store: Map<string, string> = new Map()
|
||||
|
||||
getItem(key: string): string | null {
|
||||
return this.store.get(key) ?? null
|
||||
}
|
||||
|
||||
setItem(key: string, value: string): void {
|
||||
this.store.set(key, value)
|
||||
}
|
||||
|
||||
removeItem(key: string): void {
|
||||
this.store.delete(key)
|
||||
}
|
||||
|
||||
clear(): void {
|
||||
this.store.clear()
|
||||
}
|
||||
|
||||
key(index: number): string | null {
|
||||
return Array.from(this.store.keys())[index] ?? null
|
||||
}
|
||||
|
||||
get length(): number {
|
||||
return this.store.size
|
||||
}
|
||||
}
|
||||
global.localStorage = localStorageMock as unknown as Storage
|
||||
|
||||
global.localStorage = new LocalStorageMock() as unknown as Storage
|
||||
|
||||
// Make Vue composables globally available
|
||||
global.ref = Vue.ref
|
||||
@@ -87,7 +107,31 @@ config.global.stubs = {
|
||||
VIcon: {
|
||||
name: 'v-icon',
|
||||
template: '<i class="v-icon" :class="icon" @click="$emit(\'click\')"></i>',
|
||||
props: ['icon', 'large'],
|
||||
props: ['icon', 'large', 'start', 'end', 'size'],
|
||||
emits: ['click'],
|
||||
},
|
||||
VMenu: {
|
||||
name: 'v-menu',
|
||||
template: '<div class="v-menu"><slot name="activator" :props="{}" /><slot /></div>',
|
||||
props: ['modelValue', 'closeOnContentClick'],
|
||||
},
|
||||
VList: {
|
||||
name: 'v-list',
|
||||
template: '<div class="v-list"><slot /></div>',
|
||||
},
|
||||
VListItem: {
|
||||
name: 'v-list-item',
|
||||
template: '<div class="v-list-item" :data-active="active" @click="$emit(\'click\')"><slot /><slot name="append" /></div>',
|
||||
props: ['active', 'value'],
|
||||
emits: ['click'],
|
||||
},
|
||||
VListItemTitle: {
|
||||
name: 'v-list-item-title',
|
||||
template: '<div class="v-list-item-title"><slot /></div>',
|
||||
},
|
||||
VChip: {
|
||||
name: 'v-chip',
|
||||
template: '<div class="v-chip" :class="variant"><slot /></div>',
|
||||
props: ['size', 'variant', 'prependIcon'],
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user