mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-14 07:01:17 +00:00
Feature: global search, keyboard shortcuts / hotkey support (#6449)
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing'
|
||||
|
||||
import { HotkeyDialogComponent } from './hotkey-dialog.component'
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
||||
|
||||
describe('HotkeyDialogComponent', () => {
|
||||
let component: HotkeyDialogComponent
|
||||
let fixture: ComponentFixture<HotkeyDialogComponent>
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [HotkeyDialogComponent],
|
||||
providers: [NgbActiveModal],
|
||||
}).compileComponents()
|
||||
|
||||
fixture = TestBed.createComponent(HotkeyDialogComponent)
|
||||
component = fixture.componentInstance
|
||||
fixture.detectChanges()
|
||||
})
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy()
|
||||
})
|
||||
|
||||
it('should support close', () => {
|
||||
const closeSpy = jest.spyOn(component.activeModal, 'close')
|
||||
component.close()
|
||||
expect(closeSpy).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('should format keys', () => {
|
||||
expect(component.formatKey('control.a')).toEqual('⌃ + a') // ⌃ + a
|
||||
expect(component.formatKey('control.a', true)).toEqual('⌘ + a') // ⌘ + a
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user