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

Clear validation errors when a resource template is loaded #795

Merged
merged 5 commits into from Jun 20, 2019

Conversation

aaron-collier
Copy link
Contributor

@aaron-collier aaron-collier commented Jun 20, 2019

Fixes #745

Clears the errors and sets displayValidations to false when a resource template is loaded. Adds unit testing for the values and an integration test for displaying and clearing the validation errors on the page.

Before: After validation errors and clicking on a new template - Validation errors are still displayed.

Screen Shot 2019-06-20 at 11 14 57 AM

After: After validation errors and clicking on a new template - Validation errors are cleared.

Screen Shot 2019-06-20 at 11 15 28 AM

// This assertion adds 1 to each it blocks assertion count
await pupExpect(page).toClick('a', { text: 'BIBFRAME Instance' })

// Click on one of the property type rows to expand a nested resource
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need the rest of this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah, probably not. That's just how I was manually testing it. Will update.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Good catch.

@jcoyne jcoyne merged commit 0e757da into master Jun 20, 2019
@jcoyne jcoyne deleted the amcollie_745 branch June 20, 2019 18:32
@@ -27,3 +27,8 @@ export async function fillInRequredFieldsForBibframeInstance() {
await page.waitForSelector('#rbt-menu-item-0')
await page.click('#rbt-menu-item-0')
}

export async function incompleteFieldsForBibframeInstance() {
// This assertion adds 1 to each it blocks assertion count
Copy link
Contributor

Choose a reason for hiding this comment

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

PR looks fine but I don't understand this comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not great and clarifying this, but this is the assertion that means any block "it" block that includes this call needs to check for it's assertions+1.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah! how about

// this assertion adds 1 to each "it" block's expect.assertion(n) count

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.

Errors not being cleared when new Resource Template is loaded
3 participants