hedy icon indicating copy to clipboard operation
hedy copied to clipboard

🧪 Create Cypress test for Roles of variables

Open juliabolt opened this issue 1 year ago • 5 comments

The feature flag for showing the roles of variables was set in the frontend, but now it is set as a variable in the environment, so that we can test the feature with a cypress test.

How to test

Follow these steps to verify this PR works as intended:



Checklist Done? Check if you have it all in place using this list: (mark with x if done)

  • [x ] Contains one of the PR categories in the name
  • [x ] Describes changes in the format above
  • [ ] Links to an existing issue or discussion
  • [ ] Has a "How to test" section

If you're unsure about any of these, don't hesitate to ask. We're here to help!

juliabolt avatar Jun 14 '24 11:06 juliabolt

I said in the export function runPythonProgram (file app.ts) that the type of showRoles is a boolean, but now it needs be a string then? I'll just make the type any, to be sure it's okay...

juliabolt avatar Jun 18 '24 15:06 juliabolt

I said in the export function runPythonProgram (file app.ts) that the type of showRoles is a boolean, but now it needs be a string then?

If you just send the variable it'll be a string, you can do something like:

show_roles_of_variables() == "False" 

and that'll always send a boolean

jpelay avatar Jun 18 '24 17:06 jpelay

show_roles_of_variables() == "False" and that'll always send a boolean

If I do this, then the boolean will become true when the string is "False" right? I'm confused...

juliabolt avatar Jun 20 '24 14:06 juliabolt

show_roles_of_variables() == "False" and that'll always send a boolean

If I do this, then the boolean will become true when the string is "False" right? I'm confused...

Yes, you're right! It's == True 😅

PD: I edited your comment by accident, sorry!

jpelay avatar Jun 20 '24 15:06 jpelay

some tests keep failing though... Am I still doing things wrong with the env var?

juliabolt avatar Jun 20 '24 15:06 juliabolt