|
24 | 24 | import gwt.material.design.addins.client.base.MaterialAddinsTest; |
25 | 25 | import gwt.material.design.addins.client.pathanimator.MaterialPathAnimator; |
26 | 26 | import gwt.material.design.client.ui.MaterialPanel; |
| 27 | +import gwt.material.design.jquery.client.api.Functions; |
27 | 28 |
|
28 | 29 | /** |
29 | 30 | * Test case for path animator component |
|
33 | 34 | public class MaterialPathAnimatorTest extends MaterialAddinsTest { |
34 | 35 |
|
35 | 36 | public void init() { |
36 | | - checkBasic(); |
| 37 | + checkStaticInstance(); |
| 38 | + checkProperties(); |
37 | 39 | } |
38 | 40 |
|
39 | | - protected void checkBasic() { |
| 41 | + protected void checkProperties() { |
| 42 | + final double DURATION = 300; |
| 43 | + final double TARGET_DURATION = 500; |
| 44 | + final double EXTRA_DURATION = 800; |
| 45 | + |
| 46 | + final Functions.Func animateCallback = () -> {}; |
| 47 | + final Functions.Func reverseCallback = () -> {}; |
| 48 | + final MaterialPanel source = new MaterialPanel(); |
| 49 | + final MaterialPanel target = new MaterialPanel(); |
| 50 | + |
| 51 | + MaterialPathAnimator animator = new MaterialPathAnimator(); |
| 52 | + animator.setDuration(DURATION); |
| 53 | + assertEquals(animator.getDuration(), DURATION); |
| 54 | + |
| 55 | + animator.setTargetShowDuration(TARGET_DURATION); |
| 56 | + assertEquals(animator.getTargetShowDuration(), TARGET_DURATION); |
| 57 | + |
| 58 | + animator.setAnimateCallback(animateCallback); |
| 59 | + assertEquals(animator.getAnimateCallback(), animateCallback); |
| 60 | + |
| 61 | + animator.setReverseCallback(reverseCallback); |
| 62 | + assertEquals(animator.getReverseCallback(), reverseCallback); |
| 63 | + |
| 64 | + animator.setExtraTransitionDuration(EXTRA_DURATION); |
| 65 | + assertEquals(animator.getExtraTransitionDuration(), EXTRA_DURATION); |
| 66 | + |
| 67 | + animator.setSourceElement(source.getElement()); |
| 68 | + assertEquals(animator.getSourceElement(), source.getElement()); |
| 69 | + |
| 70 | + animator.setTargetElement(target.getElement()); |
| 71 | + assertEquals(animator.getTargetElement(), target.getElement()); |
| 72 | + } |
| 73 | + |
| 74 | + protected void checkStaticInstance() { |
40 | 75 | MaterialPanel source = new MaterialPanel(); |
41 | 76 | MaterialPanel target = new MaterialPanel(); |
42 | 77 | RootPanel.get().add(source); |
|
0 commit comments