Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make validation parameter in cypress helper function as a function #4614

Open
Yokozuna59 opened this issue Jul 7, 2023 · 0 comments
Open
Labels
Status: Triage Needs to be verified, categorized, etc

Comments

@Yokozuna59
Copy link
Member

Yokozuna59 commented Jul 7, 2023

I think we need deeper validation; using imgSnapshotTest isn't enough some times, e.g., configure styles (#4527) or diagrams (#4263).
 
I'm suggesting making the parameter an object; the first parameter is a helper function, and the second is options passed to it. Since each diagram has its own attributes, maybe create a helper function with some .shoulds and expects that verifies the passed arguments are as expected. For example:
 

// cypress/helpers/pie.ts
export const pieHelper: CypressHelperFunc = (svg, options: PieAttributes) => {
   if (options.width !== undefined) {
     expect(svg).to.have.attr('width', options.width);
   }
   ...
}

 
We could add their helper method at the top of each spec file, or maybe add it to cypress/helpers with the name of the spec itself.

Originally posted by @Yokozuna59 in #4552 (comment)

@github-actions github-actions bot added the Status: Triage Needs to be verified, categorized, etc label Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc
Projects
None yet
Development

No branches or pull requests

1 participant