Skip to content
Snippets Groups Projects
Verified Commit e6024bbd authored by Sebastian Bergandy's avatar Sebastian Bergandy :keyboard:
Browse files

OZG-5977 fix edit mode setting

Sub task: OZG-7781
parent a259ecbc
No related branches found
No related tags found
1 merge request!79OZG-5977 allow for single comment edition
...@@ -79,16 +79,16 @@ describe('KommentarListItemInVorgangComponent', () => { ...@@ -79,16 +79,16 @@ describe('KommentarListItemInVorgangComponent', () => {
describe('set currently edited', () => { describe('set currently edited', () => {
const kommentar: KommentarResource = createKommentarResource(); const kommentar: KommentarResource = createKommentarResource();
it('should changed edit mode to true', () => { it('should set edit mode to false on same currently edited resource uri', () => {
component.editMode = false; component.editMode = false;
component.kommentar = kommentar; component.kommentar = kommentar;
component.currentlyEdited = getUrl(kommentar); component.currentlyEdited = getUrl(kommentar);
expect(component.editMode).toBe(true); expect(component.editMode).toBe(false);
}); });
it('should change edit mode to false', () => { it('should set edit mode to false on different currently edited resource uri', () => {
component.editMode = true; component.editMode = true;
component.kommentar = kommentar; component.kommentar = kommentar;
...@@ -96,6 +96,15 @@ describe('KommentarListItemInVorgangComponent', () => { ...@@ -96,6 +96,15 @@ describe('KommentarListItemInVorgangComponent', () => {
expect(component.editMode).toBe(false); expect(component.editMode).toBe(false);
}); });
it('should set edit mode to true', () => {
component.editMode = true;
component.kommentar = kommentar;
component.currentlyEdited = getUrl(kommentar);
expect(component.editMode).toBe(true);
});
}); });
describe('user profile', () => { describe('user profile', () => {
......
...@@ -36,7 +36,7 @@ export class KommentarListItemInVorgangComponent { ...@@ -36,7 +36,7 @@ export class KommentarListItemInVorgangComponent {
@Input() kommentarListStateResource: StateResource<KommentarListResource>; @Input() kommentarListStateResource: StateResource<KommentarListResource>;
@Input() set currentlyEdited(value: ResourceUri) { @Input() set currentlyEdited(value: ResourceUri) {
this.editMode = value === getUrl(this.kommentar); this.editMode &&= value === getUrl(this.kommentar);
} }
public kommentarService = inject(KommentarService); public kommentarService = inject(KommentarService);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment