Skip to content

Commit

Permalink
[ACS-8635] ADW: View button not working on create process (#10121)
Browse files Browse the repository at this point in the history
* [ACS-8635] ADW: View button not working on create process

* [ACS-8635] ADW: View button not working on create process
  • Loading branch information
dominikiwanekhyland authored Aug 29, 2024
1 parent ac317f8 commit 26daed9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,19 @@ describe('AttachFileWidgetComponent', () => {
await fixture.whenStable();
});

it('should raise formContentClicked event when file has sourceId', async () => {
const testFile = {
sourceId: '12345',
id: '12345',
contentAvailable: true
};
formService.formContentClicked.subscribe((file) => {
expect(file).not.toBeNull();
expect(file).toBe(testFile);
});
fixture.componentInstance.onAttachFileClicked(testFile);
});

it('should not display the show button file when is an external file', async () => {
fakePngAnswer.isExternal = true;
spyOn(processContentService, 'getFileRawContent').and.returnValue(of(fakePngAnswer));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class AttachFileWidgetComponent extends UploadWidgetComponent implements
if (file.isExternal || !file.contentAvailable) {
return;
}
if (this.isTemporaryFile(file)) {
if (this.isTemporaryFile(file) || file.sourceId) {
this.formService.formContentClicked.next(file);
} else {
this.fileClicked(file);
Expand Down

0 comments on commit 26daed9

Please sign in to comment.