mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-08-28 13:37:32 +00:00
54 lines
1.4 KiB
TypeScript
54 lines
1.4 KiB
TypeScript
import { ComponentFixture, TestBed } from '@angular/core/testing'
|
|
import { NgxBootstrapIconsModule, allIcons } from 'ngx-bootstrap-icons'
|
|
import { MetadataCollapseComponent } from './metadata-collapse.component'
|
|
|
|
const metadata = [
|
|
{
|
|
namespace: 'http://ns.adobe.com/pdf/1.3/',
|
|
prefix: 'pdf',
|
|
key: 'Producer',
|
|
value: 'pikepdf 2.2.0',
|
|
},
|
|
{
|
|
namespace: 'http://ns.adobe.com/xap/1.0/',
|
|
prefix: 'xmp',
|
|
key: 'ModifyDate',
|
|
value: '2020-12-21T08:42:26+00:00',
|
|
},
|
|
]
|
|
|
|
describe('MetadataCollapseComponent', () => {
|
|
let component: MetadataCollapseComponent
|
|
let fixture: ComponentFixture<MetadataCollapseComponent>
|
|
|
|
beforeEach(async () => {
|
|
TestBed.configureTestingModule({
|
|
providers: [],
|
|
imports: [
|
|
MetadataCollapseComponent,
|
|
NgxBootstrapIconsModule.pick(allIcons),
|
|
],
|
|
}).compileComponents()
|
|
|
|
fixture = TestBed.createComponent(MetadataCollapseComponent)
|
|
component = fixture.componentInstance
|
|
})
|
|
|
|
it('should display metadata', () => {
|
|
component.title = 'Foo'
|
|
fixture.detectChanges()
|
|
expect(fixture.debugElement.nativeElement.textContent).toContain('Foo')
|
|
})
|
|
|
|
it('should display metadata', () => {
|
|
component.metadata = metadata
|
|
fixture.detectChanges()
|
|
expect(fixture.debugElement.nativeElement.textContent).toContain(
|
|
'pikepdf 2.2.0'
|
|
)
|
|
expect(fixture.debugElement.nativeElement.textContent).toContain(
|
|
'ModifyDate'
|
|
)
|
|
})
|
|
})
|