|
| 1 | +import path from 'path'; |
| 2 | + |
| 3 | +import { expect } from '@playwright/test'; |
| 4 | + |
| 5 | +import { OpenSumiApp } from '../app'; |
| 6 | +import { OpenSumiExplorerView } from '../explorer-view'; |
| 7 | +import { OpenSumiFileTreeView } from '../filetree-view'; |
| 8 | +import { OpenSumiTerminal } from '../terminal'; |
| 9 | +import { OpenSumiWorkspace } from '../workspace'; |
| 10 | + |
| 11 | +import test, { page } from './hooks'; |
| 12 | + |
| 13 | +let app: OpenSumiApp; |
| 14 | +let explorer: OpenSumiExplorerView; |
| 15 | +let fileTreeView: OpenSumiFileTreeView; |
| 16 | +let workspace: OpenSumiWorkspace; |
| 17 | + |
| 18 | +test.describe('OpenSumi SCM Panel', () => { |
| 19 | + test.beforeAll(async () => { |
| 20 | + workspace = new OpenSumiWorkspace([path.resolve('./src/tests/workspaces/git-workspace')]); |
| 21 | + app = await OpenSumiApp.load(page, workspace); |
| 22 | + explorer = await app.open(OpenSumiExplorerView); |
| 23 | + explorer.initFileTreeView(workspace.workspace.displayName); |
| 24 | + fileTreeView = explorer.fileTreeView; |
| 25 | + }); |
| 26 | + |
| 27 | + test.afterAll(() => { |
| 28 | + app.dispose(); |
| 29 | + }); |
| 30 | + |
| 31 | + test('The "U" charset should on the files tail after git initialized', async () => { |
| 32 | + await explorer.fileTreeView.open(); |
| 33 | + const terminal = await app.open(OpenSumiTerminal); |
| 34 | + // There should have GIT on the PATH |
| 35 | + await terminal.sendText('git init'); |
| 36 | + const action = await fileTreeView.getTitleActionByName('Refresh'); |
| 37 | + await action?.click(); |
| 38 | + await app.page.waitForTimeout(2000); |
| 39 | + const node = await explorer.getFileStatTreeNodeByPath('a.js'); |
| 40 | + const badge = await node?.badge(); |
| 41 | + expect(badge).toBe('U'); |
| 42 | + }); |
| 43 | +}); |
0 commit comments