mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 06:43:35 +00:00
add testids for attachments (#9892)
This commit is contained in:
@@ -4,8 +4,8 @@
|
|||||||
<li *ngFor="let attachment of cipher.attachments">
|
<li *ngFor="let attachment of cipher.attachments">
|
||||||
<bit-item>
|
<bit-item>
|
||||||
<bit-item-content>
|
<bit-item-content>
|
||||||
{{ attachment.fileName }}
|
<span data-testid="file-name">{{ attachment.fileName }}</span>
|
||||||
<span slot="secondary">{{ attachment.sizeName }}</span>
|
<span slot="secondary" data-testid="file-size">{{ attachment.sizeName }}</span>
|
||||||
</bit-item-content>
|
</bit-item-content>
|
||||||
<ng-container slot="end">
|
<ng-container slot="end">
|
||||||
<bit-item-action>
|
<bit-item-action>
|
||||||
|
|||||||
@@ -103,6 +103,24 @@ describe("CipherAttachmentsComponent", () => {
|
|||||||
expect(component.cipher).toEqual(cipherView);
|
expect(component.cipher).toEqual(cipherView);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("sets testids for automation testing", () => {
|
||||||
|
const attachment = {
|
||||||
|
id: "1234-5678",
|
||||||
|
fileName: "test file.txt",
|
||||||
|
sizeName: "244.2 KB",
|
||||||
|
} as AttachmentView;
|
||||||
|
|
||||||
|
component.cipher.attachments = [attachment];
|
||||||
|
|
||||||
|
fixture.detectChanges();
|
||||||
|
|
||||||
|
const fileName = fixture.debugElement.query(By.css('[data-testid="file-name"]'));
|
||||||
|
const fileSize = fixture.debugElement.query(By.css('[data-testid="file-size"]'));
|
||||||
|
|
||||||
|
expect(fileName.nativeElement.textContent).toEqual(attachment.fileName);
|
||||||
|
expect(fileSize.nativeElement.textContent).toEqual(attachment.sizeName);
|
||||||
|
});
|
||||||
|
|
||||||
describe("bitSubmit", () => {
|
describe("bitSubmit", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component.submitBtn.disabled = undefined;
|
component.submitBtn.disabled = undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user