Skip to content

Commit

Permalink
add missing toolbar tests (#6489)
Browse files Browse the repository at this point in the history
  • Loading branch information
Denys Vuika authored Jan 7, 2021
1 parent 4212e13 commit c055f38
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions lib/core/toolbar/toolbar.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*!
* @license
* Copyright 2019 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { ComponentFixture, TestBed } from '@angular/core/testing';
import { TranslateModule } from '@ngx-translate/core';
import { CoreTestingModule } from '../testing/core.testing.module';
import { ToolbarComponent } from './toolbar.component';
import { ToolbarModule } from './toolbar.module';

describe('ToolbarComponent', () => {
let fixture: ComponentFixture<ToolbarComponent>;

beforeEach(() => {
TestBed.configureTestingModule({
imports: [
TranslateModule.forRoot(),
CoreTestingModule,
ToolbarModule
]
});

fixture = TestBed.createComponent(ToolbarComponent);
});

it('should render title span', async () => {
fixture.componentInstance.title = 'test-title';

fixture.detectChanges();
await fixture.whenStable();

const title: HTMLSpanElement = fixture.nativeElement.querySelector('.adf-toolbar-title');
expect(title.innerHTML).toBe('test-title');
});
});

0 comments on commit c055f38

Please sign in to comment.