Skip to content

Commit 5f9cf42

Browse files
committed
test(web): assert exact Back label and icon identities in workspace explorer test
1 parent 65282f2 commit 5f9cf42

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

apps/pythinker-web/test/workspace-explorer.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
33
import { i18n } from '../src/i18n';
44
import Sidebar from '../src/components/Sidebar.vue';
55
import WorkspaceExplorer from '../src/components/WorkspaceExplorer.vue';
6+
import Icon from '../src/components/ui/Icon.vue';
67
import type { FsEntry } from '../src/api/types';
78
import type { Session, WorkspaceGroup } from '../src/types';
89

@@ -54,10 +55,11 @@ describe('WorkspaceExplorer', () => {
5455
expect(wrapper.text()).not.toContain('Open Editors');
5556
expect(wrapper.text()).toContain('example-project');
5657
expect(wrapper.get('.ui-input[placeholder="Search files…"]').exists()).toBe(true);
57-
expect(wrapper.get('button[aria-label="Refresh files"] .ui-icon').exists()).toBe(true);
58+
const refreshButton = wrapper.get('button[aria-label="Refresh files"]');
59+
expect(refreshButton.findComponent(Icon).props('name')).toBe('refresh');
5860
const closeButton = wrapper.get('button[aria-label="Back"]');
5961
expect(closeButton.text()).toBe('Back');
60-
expect(closeButton.find('.ui-icon').exists()).toBe(true);
62+
expect(closeButton.findComponent(Icon).props('name')).toBe('back-arrow');
6163

6264
await closeButton.trigger('click');
6365
expect(wrapper.emitted('close')).toEqual([[]]);

0 commit comments

Comments
 (0)