hedyorg / hedy

Hedy is a gradual programming language to teach children programming. Gradual languages use different language levels, where each level adds new concepts and syntactic complexity. At the end of the Hedy level sequence, kids master a subset of syntactically valid Python.
https://www.hedy.org
European Union Public License 1.2
1.26k stars 281 forks source link

🧪 Create Cypress test for Roles of variables #5614

Open juliabolt opened 2 weeks ago

juliabolt commented 2 weeks ago

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)

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

juliabolt commented 1 week ago

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...

jpelay commented 1 week ago

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

juliabolt commented 1 week ago

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...

jpelay commented 1 week ago

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!

juliabolt commented 1 week ago

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