Skip to content

Commit

Permalink
feat(editor-content): add unit tests to DotFileFieldPreviewComponent #…
Browse files Browse the repository at this point in the history
  • Loading branch information
nicobytes committed Sep 26, 2024
1 parent 5654d70 commit d84ea81
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
@if (metadata.fileSize) {
<div class="preview-metadata__info">
<i class="pi pi-file"></i>
<span data-testId="metadata-file-size">{{ metadata.fileSize | dotFileSizeFormat }}</span>
<span data-testId="metadata-file-size">
{{ metadata.fileSize | dotFileSizeFormat }}
</span>
</div>
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,18 @@ describe('DotFileFieldPreviewComponent', () => {
spectator.detectChanges();

const infoBtnElement = spectator.query(byTestId('info-btn'));

const dialogComponent = spectator.query(Dialog);

spectator.click(infoBtnElement);
expect(dialogComponent.visible).toBeTruthy();
});


it('should show a dialog when click on the proper responsive btn', async () => {
spectator.detectChanges();

const infoBtnElement = spectator.query(byTestId('info-btn-responsive'));

const dialogComponent = spectator.query(Dialog);

spectator.click(infoBtnElement);
Expand Down Expand Up @@ -150,7 +149,7 @@ describe('DotFileFieldPreviewComponent', () => {

const links = spectator.queryAll('.file-info__item');
const copyBtns = spectator.queryAll(DotCopyButtonComponent);

expect(links.length).toBe(4);
expect(copyBtns.length).toBe(3);
});
Expand Down

0 comments on commit d84ea81

Please sign in to comment.