forked from mystiq/hydrogen-web
Add a couple consistent selectors to reference in tests
Using `data-testid` because it seems generic out of the list from: - https://docs.cypress.io/guides/core-concepts/cypress-app#Uniqueness - https://docs.cypress.io/guides/references/best-practices#How-It-Works
This commit is contained in:
parent
5b54280ac2
commit
c59f65e43b
2 changed files with 2 additions and 2 deletions
|
@ -31,7 +31,7 @@ export function renderStaticAvatar(vm, size, extraClasses = undefined) {
|
||||||
avatarClasses += ` ${extraClasses}`;
|
avatarClasses += ` ${extraClasses}`;
|
||||||
}
|
}
|
||||||
const avatarContent = hasAvatar ? renderImg(vm, size) : text(vm.avatarLetter);
|
const avatarContent = hasAvatar ? renderImg(vm, size) : text(vm.avatarLetter);
|
||||||
const avatar = tag.div({className: avatarClasses}, [avatarContent]);
|
const avatar = tag.div({className: avatarClasses, "data-testid": "avatar"}, [avatarContent]);
|
||||||
if (hasAvatar) {
|
if (hasAvatar) {
|
||||||
setAttribute(avatar, "data-avatar-letter", vm.avatarLetter);
|
setAttribute(avatar, "data-avatar-letter", vm.avatarLetter);
|
||||||
setAttribute(avatar, "data-avatar-color", vm.avatarColorNumber);
|
setAttribute(avatar, "data-avatar-color", vm.avatarColorNumber);
|
||||||
|
|
|
@ -53,7 +53,7 @@ export class BaseMediaView extends BaseMessageView {
|
||||||
children.push(progress);
|
children.push(progress);
|
||||||
}
|
}
|
||||||
return t.div({className: "Timeline_messageBody"}, [
|
return t.div({className: "Timeline_messageBody"}, [
|
||||||
t.div({className: "media", style: `max-width: ${vm.width}px`}, children),
|
t.div({className: "media", style: `max-width: ${vm.width}px`, "data-testid": "media"}, children),
|
||||||
t.if(vm => vm.error, t => t.p({className: "error"}, vm.error))
|
t.if(vm => vm.error, t => t.p({className: "error"}, vm.error))
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue