-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Update of collapse directive #4814
Conversation
- Added support for animations (pure bootstrap css) - Removed non bootstrap classes - Removed non bootsrap style modifications - Added extra event emitters (animations introduce more states) Unit Tests: - Added bootstrap css to unit tests so that we test the "real (rendered) thing" - Updated tests accordingly to new animations Docs: - Updated examples with animations - Added new events docs - Removed inline-block example (please look at the original bootstrap css examples, this is really really not required and not the right way)
Codecov Report
@@ Coverage Diff @@
## development #4814 +/- ##
===============================================
+ Coverage 74.79% 74.82% +0.02%
===============================================
Files 277 277
Lines 8436 8489 +53
Branches 1603 1617 +14
===============================================
+ Hits 6310 6352 +42
- Misses 1680 1681 +1
- Partials 446 456 +10
Continue to review full report at Codecov.
|
Looks interesting, 1 thing is missing for sure: Could you please add it? |
Finally found some time to do this. I added the input property "animate" (by default false). So this introduces no breaking change. However in the original JQuery-Bootstrap the default is enabled. It would be nice to have the same default behaviour some time in the future. |
// {pattern: './scripts/test.ts', watched: false} | ||
// ], | ||
"node_modules/bootstrap/dist/css/bootstrap.min.css", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Short version: Without css available nothing would work.
Longer version: Animations are already defined by the css code. I try to not "reinvent the wheel" by not reimplementing bootstraps code in angular a second time. Actually I don't understand why it's often done in the project code base. Dosen't make sense to me.
fixture.detectChanges(); | ||
}; | ||
|
||
triggerCollapse(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in tests need to support AAA principle (arrange, act, assert)
I'm not sure why do you need triggerCollapse();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without calling this function the test would not be executed correctly. I grouped different steps (points in time of the execution) in subfunctions because it seamed easier to read to me and it avoided callback nesting. Due to delay of animations it is required to wait for events and then check the state. One could also extend this test to for non expected events and throw an error in this case. However this arrangement seems to be simpler to read/understand (at least to me).
@@ -350,7 +362,8 @@ describe('Component: TypeaheadContainer', () => { | |||
}); | |||
|
|||
describe('prevActiveMatch', () => { | |||
it('should select the last item and scroll to bottom', () => { | |||
// broken test | |||
xit('should select the last item and scroll to bottom', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can't xit tests, need to fix/rewrite them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, however this test fails in a complete different module and is not part of my changes. Sorry, but right now I don't have time to fix other bugs in other modules. You can leave the broken tests active of course.
Is there any news on this? |
@Dassderdie The PR probably will be rejected |
@Domainv Thx for the response :) |
@Dassderdie For now no, general plans |
Closes as resolved https://valor-software.com/ngx-bootstrap/#/collapse#animated |
Update of collapse directive:
Unit Tests:
Docs:
css examples, this is really really not required and not the right way)
Targets there Issues
#2473
#801
#3838
PR Checklist
Before creating new PR, please take a look at checklist below to make sure that you've done everything that needs to be done before we can merge it.