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

Re #158, temp fix for simple index_var detection #160

Merged
merged 2 commits into from
Mar 5, 2021
Merged

Conversation

plocket
Copy link
Collaborator

@plocket plocket commented Mar 3, 2021

Vars might be set out of order. Addresses #158, but does not close it. This will let some tests work under some circumstances. This test shows the result (passes).

Vars might be set out of order.
@@ -402,17 +438,29 @@ module.exports = {
let noneOfTheAboveCheckbox = fieldset.querySelector('input.danota-checkbox');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make clear somehow that only one of base64_id_of_first_choice and base64_id_of_index will exist. The way we check for both made it seem to me like both of these might be true somehow. Same for base64_var_name and base64_index.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be negated by using the second comment to clarify the code. Thanks!

@@ -380,9 +390,35 @@ module.exports = {
// 'none of the above' checkbox showif???
`input[name="${ name_attr_B }"]`, // checkbox
`input[name="${ name_attr_R }"]`, // checkbox alt

// simple index var case as described above
`button[name="${ base64_index }"][value="${ choice_name }"]`, // button
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can avoid all these repetition in selector clauses by setting a variable, e.g., base_64_var_or_index to either a variable name or an index variable. We have the ability to detect whether a given argument var_name is a variable name or an index name. So once we know which one it is, we can just use that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants