Skip to content

Commit

Permalink
update test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ntqdinh-axonivy committed Aug 29, 2024
1 parent aed62b5 commit 06de2ae
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,4 +316,22 @@ describe('ProductDetailComponent', () => {
component.onResize();
expect(component.checkMediaSize).toHaveBeenCalled();
});

it('should be empty selected version if product detail content is missing', () => {
component.productModuleContent.set({} as ProductModuleContent);
component.selectedVersion = '';
component.handleProductContentVersion();
expect(component.selectedVersion).toEqual('');
});

it('should be formated selected version if open in designer', () => {
const mockContent: ProductModuleContent = {
...MOCK_PRODUCT_MODULE_CONTENT,
tag: '10.0.11'
};
component.productModuleContent.set(mockContent);
routingQueryParamService.isDesignerEnv.and.returnValue(true);
component.handleProductContentVersion();
expect(component.selectedVersion).toEqual('Version 10.0.11');
});
});

0 comments on commit 06de2ae

Please sign in to comment.