You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Improve Percy stability by better scoping snapshots (#10207)
This commit is contained in:
committed by
GitHub
parent
1a08c6ba3a
commit
26652138bd
@ -22,6 +22,7 @@ declare global {
|
||||
namespace Cypress {
|
||||
interface SnapshotOptions extends PercySnapshotOptions {
|
||||
domTransformation?: (documentClone: Document) => void;
|
||||
allowSpinners?: boolean;
|
||||
}
|
||||
|
||||
interface Chainable {
|
||||
@ -38,6 +39,10 @@ declare global {
|
||||
}
|
||||
|
||||
Cypress.Commands.add("percySnapshotElement", { prevSubject: "element" }, (subject, name, options) => {
|
||||
if (!options?.allowSpinners) {
|
||||
// Await spinners to vanish
|
||||
cy.get(".mx_Spinner").should("not.exist");
|
||||
}
|
||||
cy.percySnapshot(name, {
|
||||
domTransformation: (documentClone) => scope(documentClone, subject.selector),
|
||||
...options,
|
||||
|
Reference in New Issue
Block a user