-
Notifications
You must be signed in to change notification settings - Fork 649
Fix form.key issues #874
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
Fix form.key issues #874
Conversation
mocha reporter is better than dots + progress but especially for diff output as it is needed to see deep comparisons between arrays/objects (for example while looking at wrong keys in the sf-field.directive tests)
Note that tests will fail because this depends on json-schema-form/angular-schema-form-bootstrap#42 |
@mnzaki I added your bootstrap change and it is still failing on strings, is something else missing? Oh and thanks for noticing the dupe of tests, they were previously breaking the loop so I had to split them out to update the loop logic and forgot to clean them up. |
It needs to be built as the karma tests use the built file in |
Also there's one more fix missing here, the issue that I explained in this comment about these lines: scope.initialForm = Object.assign({}, sfSchema.lookup['f' + attrs.sfField]);
/*->*/ scope.form = sfSchema.lookup['f' + attrs.sfField]; I was hesitant about fixing this as well as it might introduce bugs in projects using ASF and depending on this unexpected side effect (ie, updating form object and getting things changed without broadcasting a redraw event). What do you think? |
@mnzaki I did the build, that's why it started passing two of the three, it was failing all three originally :) |
@Anthropic I don't really fully know how the tests are run on Travis. But on You built angular-schema-form-bootstrap and pushed that to the |
@mnzaki travisci clones the whole repo, then apply and merge the pr before running the tests, you can see the output here https://travis-ci.org/json-schema-form/angular-schema-form/pull_requests I believe that's visible to anyone. You can see that after I committed the re-built dist folder the test result changed, objects and strings failed in the last run but then only strings the next time. I had a quick look last night, but I need more time tonight to hopefully fix the strings, seems like there just a duplication of the key I need to eliminate. |
@Anthropic yes and then it runs the tests through |
@mnzaki ah d'oh sorry was in too much of a rush to notice, I really should update the tests to run a build into a folder ignored by git... one day... thanks for taking the time to make sense for me! :) I will try to look at your other suggestion shortly. |
@Anthropic btw I think just changing the npm test script to |
@mnzaki cheers, updated locally, will push on the weekend :) |
Description
Generate proper form keys for arrays of strings and arrays of objects, and add some tests for it.
This also depends on a fix in angular-schema-form-bootstrap, specifically removing the
sf-key-controller
fromfieldset.html
Fixes Related issues
Issue #870
Checklist
@json-schema-form/angular-schema-form-lead