🎨 Simplify import formatting and improve code readability in unit tests for GamemasterExplorer component

This commit is contained in:
2026-01-29 05:05:47 +00:00
parent dbf60a4860
commit e55740782e

View File

@@ -105,9 +105,8 @@ describe('GamemasterExplorer', () => {
});
it('shows loading state when isLoading is true', async () => {
const { useGamemasterFiles } = await import(
'../../../src/composables/useGamemasterFiles.js'
);
const { useGamemasterFiles } =
await import('../../../src/composables/useGamemasterFiles.js');
useGamemasterFiles.mockReturnValueOnce({
selectedFile: ref(''),
fileContent: ref(''),
@@ -127,9 +126,8 @@ describe('GamemasterExplorer', () => {
});
it('shows error state when fileError exists', async () => {
const { useGamemasterFiles } = await import(
'../../../src/composables/useGamemasterFiles.js'
);
const { useGamemasterFiles } =
await import('../../../src/composables/useGamemasterFiles.js');
useGamemasterFiles.mockReturnValueOnce({
selectedFile: ref(''),
fileContent: ref(''),
@@ -149,9 +147,8 @@ describe('GamemasterExplorer', () => {
});
it('shows no files state when hasFiles is false', async () => {
const { useGamemasterFiles } = await import(
'../../../src/composables/useGamemasterFiles.js'
);
const { useGamemasterFiles } =
await import('../../../src/composables/useGamemasterFiles.js');
useGamemasterFiles.mockReturnValueOnce({
selectedFile: ref(''),
fileContent: ref(''),
@@ -193,7 +190,9 @@ describe('GamemasterExplorer', () => {
expect(wrapper.findComponent({ name: 'JsonViewer' }).exists()).toBe(true);
// Check for ActionToolbar component
expect(wrapper.findComponent({ name: 'ActionToolbar' }).exists()).toBe(true);
expect(wrapper.findComponent({ name: 'ActionToolbar' }).exists()).toBe(
true
);
});
it('toggles help panel', async () => {
@@ -231,9 +230,8 @@ describe('GamemasterExplorer', () => {
});
it('calls loadStatus on mount', async () => {
const { useGamemasterFiles } = await import(
'../../../src/composables/useGamemasterFiles.js'
);
const { useGamemasterFiles } =
await import('../../../src/composables/useGamemasterFiles.js');
const mockLoadStatus = vi.fn();
useGamemasterFiles.mockReturnValueOnce({
selectedFile: ref(''),
@@ -263,9 +261,8 @@ describe('GamemasterExplorer', () => {
});
it('displays toast messages for clipboard operations', async () => {
const { useClipboard } = await import(
'../../../src/composables/useClipboard.js'
);
const { useClipboard } =
await import('../../../src/composables/useClipboard.js');
useClipboard.mockReturnValueOnce({
copied: ref(true),
error: ref(null),