Skip to content
Snippets Groups Projects
Commit ac081feb authored by Martin's avatar Martin
Browse files

Merge branch 'OZG-5977-MultipleFileUpload' of...

Merge branch 'OZG-5977-MultipleFileUpload' of code.schleswig-holstein.de:ozg-cloud/app/frontend-clients into OZG-5977-MultipleFileUpload
parents ce8a26f9 4af3b4b9
No related branches found
No related tags found
1 merge request!67OZG-5977 add multi option to file upload button
......@@ -31,6 +31,7 @@
[accept]="accept"
(click)="resetInput()"
[disabled]="isLoading"
[multiple]="multi"
[attr.data-test-id]="(id | convertForDataTest) + '-file-upload-input'"
/>
<label
......
......@@ -25,6 +25,7 @@ import { TechSharedModule } from '@alfa-client/tech-shared';
import { getElementFromFixture } from '@alfa-client/test-utils';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { faker } from '@faker-js/faker';
import { expect } from '@jest/globals';
import { getDataTestIdOf } from 'libs/tech-shared/test/data-test';
import { FileUploadButtonComponent } from './file-upload-button.component';
......@@ -61,4 +62,15 @@ describe('FileUploadButtonComponent', () => {
expect(component.resetInput).toHaveBeenCalled();
});
});
describe('template', () => {
it('should have inputs', () => {
component.multi = true;
fixture.detectChanges();
const inputElement: HTMLInputElement = getElementFromFixture(fixture, inputTestClass);
expect(inputElement.multiple).toEqual(component.multi);
});
});
});
......@@ -36,6 +36,7 @@ export class FileUploadButtonComponent {
@Input({ required: true }) id!: string;
@Input() isLoading: boolean = false;
@Input() accept: string = '*/*';
@Input() multi: boolean = false;
@ViewChild('inputElement') inputElement: ElementRef = new ElementRef({});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment