Skip to content
Snippets Groups Projects
Commit c335a46c authored by Jan Zickermann's avatar Jan Zickermann
Browse files

OZG-4948 Remove button disabled on submit

parent ef25f30f
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,6 @@
<button
(click)="submit()"
[disabled]="isSubmitting"
data-test-id="save-button"
class="bg-ozgblue-700 hover:bg-ozgblue-600 active:bg-ozgblue-600/90 focus-visible:outline-ozgblue-800 rounded-md px-3 py-2 text-sm font-semibold text-white shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2"
>
......
......@@ -74,7 +74,7 @@ describe('PostfachFormComponent', () => {
it('should use form control for signatur-text', () => {
const someText = 'some signatur text';
form.get(PostfachFormService.SIGNATUR_FIELD)!!.setValue(someText);
form.get(PostfachFormService.SIGNATUR_FIELD).setValue(someText);
const signatur = getElementFromFixture(fixture, signaturTextarea);
expect(signatur.value).toBe(someText);
......@@ -89,23 +89,5 @@ describe('PostfachFormComponent', () => {
expect(component.submit).toHaveBeenCalled();
});
it('should be enabled', () => {
component.isSubmitting = false;
fixture.detectChanges();
const buttonElement: HTMLButtonElement = getElementFromFixture(fixture, saveButton);
expect(buttonElement.disabled).toBe(false);
});
it('should be disabled during submit', () => {
component.isSubmitting = true;
fixture.detectChanges();
const buttonElement: HTMLButtonElement = getElementFromFixture(fixture, saveButton);
expect(buttonElement.disabled).toBe(true);
});
});
});
......@@ -8,16 +8,11 @@ import { PostfachFormService } from './postfach.formservice';
providers: [PostfachFormService],
})
export class PostfachFormComponent {
public isSubmitting = false;
constructor(public formService: PostfachFormService) {}
protected readonly PostfachFormService = PostfachFormService;
submit() {
this.isSubmitting = true;
this.formService.submit().subscribe(() => {
this.isSubmitting = false;
});
this.formService.submit();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment