Skip to content

Commit

Permalink
test(repo): improve unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
robsonos committed Dec 29, 2024
1 parent d2c34d8 commit 8b42eb6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 6 additions & 1 deletion apps/spie-ui/src/app/services/electron.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ describe('ElectronService', () => {
});

describe('quit', () => {
it('should call window.electron.quit with the default code (0)', () => {
service.quit();
expect(mockElectronAPI.quit).toHaveBeenCalledWith(0); // Default value
});

it('should call window.electron.quit with the specified code', () => {
const code = 1;
service.quit(code);
expect(mockElectronAPI.quit).toHaveBeenCalledWith(1);
expect(mockElectronAPI.quit).toHaveBeenCalledWith(code);
});
});

Expand Down
6 changes: 1 addition & 5 deletions apps/spie-ui/src/app/utils/message-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export default class MessageParser {
const tokens: string[] = [];

message.split(delimiterRegex).forEach((part, index) => {
if (!part) {
return;
}

if (part.includes(':')) {
const [key, value] = part.split(':').map((s) => s.trim());
if (key && value) {
Expand Down Expand Up @@ -83,7 +79,7 @@ export default class MessageParser {

return Array.from(datasetNames).map((label) => ({
name: label,
data: datasetData[label] || [],
data: datasetData[label],
}));
}
}

0 comments on commit 8b42eb6

Please sign in to comment.