-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from DTStack/test/activityBar
Test/activity bar
- Loading branch information
Showing
16 changed files
with
218 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,5 @@ commitlint.config.js | |
tsconfig.build.json | ||
tsconfig.base.json | ||
jest.config.js | ||
lib/test | ||
lib/stories |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = 'test-file-stub'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
languages: { | ||
register: function (language) {}, | ||
setMonarchTokensProvider: function (name, tokens) {}, | ||
registerCompletionItemProvider: function (name, provider) {}, | ||
}, | ||
editor: { | ||
defineTheme: function (name, theme) {}, | ||
setTheme: function (theme) {}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/components/actionBar/__tests__/__snapshots__/actionBar.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Test ActionBar Component Test the ActionBar Snapshot 1`] = ` | ||
<div | ||
className="mo-action-bar" | ||
> | ||
<ul | ||
className="mo-action-bar__container" | ||
> | ||
<li | ||
className="mo-action-bar__item" | ||
onClick={[Function]} | ||
> | ||
<a | ||
className="mo-action-bar__label codicon codicon-add" | ||
title="mockDataTitle" | ||
/> | ||
</li> | ||
</ul> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import * as React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import renderer from 'react-test-renderer'; | ||
|
||
import ActionBar from '../index'; | ||
|
||
const mockData = [ | ||
{ | ||
id: '1', | ||
title: 'mockDataTitle', | ||
iconName: 'codicon-add', | ||
}, | ||
]; | ||
|
||
describe('Test ActionBar Component', () => { | ||
test('Test the ActionBar Snapshot', () => { | ||
const component = renderer.create(<ActionBar data={mockData} />); | ||
const tree = component.toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
test('Test the ActionBar by the data Props', () => { | ||
render(<ActionBar data={mockData} />); | ||
expect(screen.getByTitle(/mockDataTitle/)).not.toBeNull(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import { MoleculeProvider } from 'mo'; | ||
|
||
import { MainBench } from '../index'; | ||
|
||
describe('Test MainBench Component', () => { | ||
test('The MainBench DOM Testing', () => { | ||
render( | ||
<MoleculeProvider> | ||
<MainBench /> | ||
</MoleculeProvider> | ||
); | ||
|
||
expect(screen.queryByText(/Explorer/)).not.toBeNull(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
import { MoleculeProvider } from 'mo'; | ||
|
||
import { Workbench } from '../index'; | ||
|
||
describe('Test Workbench Component', () => { | ||
test('The Workbench DOM Testing', () => { | ||
const { container } = render( | ||
<MoleculeProvider> | ||
<Workbench /> | ||
</MoleculeProvider> | ||
); | ||
expect(container.querySelector('#molecule')).not.toBeNull(); | ||
expect(container.querySelector('.mo-workbench')).not.toBeNull(); | ||
expect(container.querySelector('.mo-statusBar')).not.toBeNull(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { extensionService } from 'mo'; | ||
|
||
describe('Test Mo Entry', () => { | ||
test('Instance the extensionService', () => { | ||
expect(extensionService).not.toBeNull(); | ||
}); | ||
}); |
Oops, something went wrong.