Skip to content

Commit

Permalink
remove unused unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
tutn-axonivy committed Aug 30, 2024
1 parent a7a6621 commit 4474915
Showing 1 changed file with 0 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,61 +149,6 @@ describe('ProductDetailComponent', () => {
expect(component.setActiveTab).toHaveBeenCalledWith('description');
});

it('should return true for description when it is not null and not empty', () => {
const mockContent: ProductModuleContent = {
...MOCK_PRODUCT_MODULE_CONTENT,
description: { en: 'Test description' }
};

component.productModuleContent.set(mockContent);
expect(component.getContent('description')).toBeTrue();
});

it('should return false in tab visibility when product module content is missing', () => {
const mockEmptyContent: ProductModuleContent = {} as ProductModuleContent;
component.productModuleContent.set(mockEmptyContent);
expect(component.getContent('description')).toBeFalse();
expect(component.getContent('demo')).toBeFalse();
expect(component.getContent('setup')).toBeFalse();
expect(component.getContent('dependency')).toBeFalse();
});

it('should return false for description when it is null or empty', () => {
const mockContentWithEmptyDescription: ProductModuleContent =
MOCK_PRODUCT_MODULE_CONTENT;
component.productModuleContent.set(mockContentWithEmptyDescription);
expect(component.getContent('description')).toBeFalse();

const mockContentWithNullDescription: ProductModuleContent = {
...MOCK_PRODUCT_MODULE_CONTENT
};
component.productModuleContent.set(mockContentWithNullDescription);
expect(component.getContent('description')).toBeFalse();
});

it('should return true for setup when it is not null and not empty', () => {
const mockContent: ProductModuleContent = {
...MOCK_PRODUCT_MODULE_CONTENT,
setup: { en: 'Test setup' }
};

component.productModuleContent.set(mockContent);
expect(component.getContent('setup')).toBeTrue();
});

it('should return false for setup when it is null or empty', () => {
const mockContentWithEmptySetup: ProductModuleContent =
MOCK_PRODUCT_MODULE_CONTENT;
component.productModuleContent.set(mockContentWithEmptySetup);
expect(component.getContent('setup')).toBeFalse();

const mockContentWithNullSetup: ProductModuleContent = {
...MOCK_PRODUCT_MODULE_CONTENT
};
component.productModuleContent.set(mockContentWithNullSetup);
expect(component.getContent('setup')).toBeFalse();
});

it('should not display information when product detail is empty', () => {
const mockContentWithEmptySetup: ProductModuleContent =
{} as ProductModuleContent;
Expand Down

0 comments on commit 4474915

Please sign in to comment.