Skip to content

Commit

Permalink
Adiciona teste para o componente de abrir menu
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielaTiago committed Nov 16, 2023
1 parent e5d9091 commit ca5ae2e
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions src/app/components/background/background.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ describe('BackgroundComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ BackgroundComponent ],
imports: [RouterTestingModule]
})
.compileComponents();
declarations: [BackgroundComponent],
imports: [RouterTestingModule],
}).compileComponents();

fixture = TestBed.createComponent(BackgroundComponent);
component = fixture.componentInstance;
Expand All @@ -22,4 +21,20 @@ describe('BackgroundComponent', () => {
it('should create', () => {
expect(component).toBeTruthy();
});

it('should initialize isMenuOpened to false', () => {
expect(component.isMenuOpened).toBe(false);
});

it('should toggle isMenuOpened when toggleMenu is called', () => {
expect(component.isMenuOpened).toBe(false);

component.toggleMenu();

expect(component.isMenuOpened).toBe(true);

component.toggleMenu();

expect(component.isMenuOpened).toBe(false);
});
});

0 comments on commit ca5ae2e

Please sign in to comment.