Skip to content

Commit

Permalink
ACS-6252 Move to beforeEach
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksanderSklorz committed Nov 28, 2023
1 parent fc41925 commit cd02a0d
Showing 1 changed file with 4 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,6 @@ describe('RuleDetailsUiComponent', () => {

beforeEach(() => {
categoryService = TestBed.inject(CategoryService);
});

it('should have assigned not filtered out category related actions from actionDefinitions if categoryService.areCategoriesEnabled returns true', () => {
spyOn(categoryService, 'areCategoriesEnabled').and.returnValue(true);
component.actionDefinitions = [
{
id: 'link-category',
Expand All @@ -175,6 +171,10 @@ describe('RuleDetailsUiComponent', () => {
parameterDefinitions: []
}
];
});

it('should have assigned not filtered out category related actions from actionDefinitions if categoryService.areCategoriesEnabled returns true', () => {
spyOn(categoryService, 'areCategoriesEnabled').and.returnValue(true);

fixture.detectChanges();
expect(categoryService.areCategoriesEnabled).toHaveBeenCalled();
Expand All @@ -184,26 +184,6 @@ describe('RuleDetailsUiComponent', () => {

it('should have assigned filter out category related actions from actionDefinitions if categoryService.areCategoriesEnabled returns false', () => {
spyOn(categoryService, 'areCategoriesEnabled').and.returnValue(false);
component.actionDefinitions = [
{
id: 'link-category',
name: 'test name',
description: 'some description',
title: 'some title',
applicableTypes: [],
trackStatus: false,
parameterDefinitions: []
},
{
id: 'test id',
name: 'test name 2',
description: 'some description',
title: 'some title',
applicableTypes: [],
trackStatus: false,
parameterDefinitions: []
}
];

fixture.detectChanges();
expect(categoryService.areCategoriesEnabled).toHaveBeenCalled();
Expand Down

0 comments on commit cd02a0d

Please sign in to comment.