Skip to content

Commit c808b12

Browse files
linhewewoor
linhe
authored andcommitted
feat(panel service): modify panel service test code
1 parent aa6b32d commit c808b12

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

src/services/problemsService.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export class ProblemsService
127127
let warnings = 0;
128128
let errors = 0;
129129
let infos = 0;
130-
let hint = 0;
130+
// let hint = 0;
131131
const loopTreeNode = (tree: IProblemsItem[]) => {
132132
tree.forEach((element: IProblemsItem) => {
133133
switch (element.value.status) {
@@ -141,7 +141,7 @@ export class ProblemsService
141141
warnings += 1;
142142
break;
143143
default:
144-
hint += 1;
144+
// hint += 1;
145145
}
146146
if (element.children && element.children.length) {
147147
loopTreeNode(element.children);

src/services/workbench/__tests__/panelService.test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import 'reflect-metadata';
22
import { container } from 'tsyringe';
33
import { IPanelService, PanelService } from '../panelService';
4-
import { PANEL_OUTPUT, PANEL_PROBLEMS } from 'mo/model/workbench/panel';
4+
import { PANEL_OUTPUT } from 'mo/model/workbench/panel';
5+
import { PANEL_PROBLEMS } from 'mo/model/problems';
56

67
describe('Test panelService', () => {
78
const panelService = container.resolve<IPanelService>(PanelService);

src/workbench/panel/__tests__/panel.test.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { render } from '@testing-library/react';
33
import { MoleculeProvider } from 'mo/provider';
44

55
import { PanelView } from '../index';
6-
import { PANEL_OUTPUT, PANEL_PROBLEMS } from 'mo/model/workbench/panel';
6+
import { PANEL_OUTPUT } from 'mo/model/workbench/panel';
7+
import { PANEL_PROBLEMS } from 'mo/model/problems';
78

89
describe('Test Panel Component', () => {
910
test('Test Panel DOM render', async () => {

stories/extensions/test/testPane.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,11 @@ export type GenericClassDecorator<T> = (target: T) => void;`,
127127
});
128128
let notify;
129129
const addANotification = function () {
130-
notify = notificationService.addNotification<string>({
131-
value: 'Test Notification!',
132-
});
130+
notify = notificationService.addNotifications<string>([
131+
{
132+
value: 'Test Notification!',
133+
},
134+
]);
133135
console.log('Add Notification index:', notify);
134136
};
135137

0 commit comments

Comments
 (0)