-
Notifications
You must be signed in to change notification settings - Fork 136
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
Problem with ion-slides #227
Comments
I am AFK this weekend.
My guess is that one of the mock classes we are using is missing a property
that's meant to contain removeAttribute.
Have a look in cleanupStyles in the slides source code (referenced in your
stack trace) to see what it is?
…On Fri, 17 Feb 2017 at 07:06, Rodrigo Diego ***@***.***> wrote:
Adding in any HTML tag
<ion-slide>
<img src="url">
</ion-slide>
<ion-slide>
<img src="url">
</ion-slide>
<ion-slide>
<img src="url">
</ion-slide>
</ion-slides>
and run "npm test"
Error:
LoginPage:
✖ Should be create Login Page
Chrome 56.0.2924 (Mac OS X 10.12.3)
Error: Error in ./homePage class homePage - inline template:62:6 caused
by: Cannot read property 'removeAttribute' of undefined
TypeError: Cannot read property 'removeAttribute' of undefined
at cleanupStyles (webpack:////ionic-angular/components/slides/swiper/swiper.js:797:0
<- src/test.ts:28038:16)
at destroySwiper (webpack:////ionic-angular/components/slides/swiper/swiper.js:831:0
<- src/test.ts:28072:5)
at Slides.ngOnDestroy (webpack:////ionic-angular/components/slides/slides.js:914:0
<- src/test.ts:44412:101)
at Wrapper_Slides.ngOnDestroy
(/IonicModule/Slides/wrapper.ngfactory.js:27:16)
at CompiledTemplate.proxyViewClass.View_homePage0.destroyInternal
(/DynamicTestModule/homePage/component.ngfactory.js:501:21)
at CompiledTemplate.proxyViewClass.AppView.destroy ***@***.***/core/src/linker/view.js:143:0
<- src/test.ts:82548:14)
at CompiledTemplate.proxyViewClass.DebugAppView.destroy ***@***.***/core/src/linker/view.js:371:0
<- src/test.ts:82776:38)
at CompiledTemplate.proxyViewClass.View_homePage_Host0.destroyInternal
(/DynamicTestModule/homePage/host.ngfactory.js:33:19)
at CompiledTemplate.proxyViewClass.AppView.destroy ***@***.***/core/src/linker/view.js:143:0
<- src/test.ts:82548:14)
at CompiledTemplate.proxyViewClass.DebugAppView.destroy
***@***.***/core/src/linker/view.js:371:0 <-
src/test.ts:82776:38)
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.8.6
ios-sim version: 5.0.11
OS: macOS Sierra
Node Version: v6.9.0
Xcode version: Xcode 8.1 Build version 8B62
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#227>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AG5tSIShbZmIX_vopqjqO5VdNwy9yke8ks5rdKw-gaJpZM4MDe23>
.
|
Any luck? |
Don't resolve :( But, I'm just testing methods in my page and ignore slides in tag.... Thx |
The error is coming from here in swiper.js: /*=========================
Translate/transition helpers
===========================*/
// Cleanup dynamic styles
function cleanupStyles(s) {
// Container
removeClass(s.container, s._classNames);
s.container.removeAttribute('style'); |
Ahah, there's actually an earlier error: Uncaught TypeError: this._plt.timeout is not a function Which is because we don't mock timeout in platformmock |
Fixing the above is trivial, but afterwards it seems that initSlides (which creates slides.component) is not called. |
Spent ages trying to figure out why the slides weren't being initialised, but it goes back to the first error: this._plt.timeout(function () {
_this._initSlides();
}, 300); If we mock out the timeout function to do nothing.. then nothing will happen |
We were missing five functions from PlatformMock necessary for the Slides to work. If you update your copy of PlatformMock you should find they will test fine now. |
Thx, but this error continues.... HTML:
Plataform mock added 5 functions... Error: Error in ./homePage class homePage - inline template:66:6 caused by: Cannot read property 'removeAttribute' of undefined |
You'll need to provide a repro case as I can no longer reproduce here
against the latest version of clicker.
On Fri, 24 Feb 2017 at 23:59, Rodrigo Diego <notifications@github.com> wrote:
Sorry, but this error continues....
HTML:
<ion-slide>
<img src""img>
</ion-slide>
<ion-slide>
<img src""img>
</ion-slide>
<ion-slide>
<img src""img>
</ion-slide>
</ion-slides>
Plataform mock added 5 functions...
Error: Error in ./homePage class homePage - inline template:66:6 caused by:
Cannot read property 'removeAttribute' of undefined
TypeError: Cannot read property 'removeAttribute' of undefined
at cleanupStyles
(webpack:////ionic-angular/components/slides/swiper/swiper.js:797:0
<- src/test.ts:28898:16)
at destroySwiper
(webpack:////ionic-angular/components/slides/swiper/swiper.js:831:0
<- src/test.ts:28932:5)
at Slides.ngOnDestroy
(webpack:////ionic-angular/components/slides/slides.js:914:0
<- src/test.ts:45272:101)
at Wrapper_Slides.ngOnDestroy
(/IonicModule/Slides/wrapper.ngfactory.js:27:16)
at CompiledTemplate.proxyViewClass.View_homePage0.destroyInternal
(/DynamicTestModule/homePage/component.ngfactory.js:591:21)
at CompiledTemplate.proxyViewClass.AppView.destroy
(webpack:////@angular/core/src/linker/view.js:143:0
<- src/test.ts:82767:14)
at CompiledTemplate.proxyViewClass.DebugAppView.destroy
(webpack:///~/@angular/core/src/linker/view.js:371:0 <-
src/test.ts:82995:38)
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#227 (comment)>,
or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AG5tSMD6MSYoFjXilxDA2Sjzlybo5Yocks5rftQugaJpZM4MDe23>
.
|
Where namespace swipes are on ionic-angular ? |
I Tried make this Mock but I don´t know the Slides namespace
|
I'm testing a page and facing the same problem
this function is called inside another function destroySwiper() but the attributes container and _wrapper are missing so I get a TypeError by calling removeAttribute on undefined :-( |
Did you check out the linked issue? |
Adding in any HTML tag
and run "npm test"
Error:
LoginPage:
✖ Should be create Login Page
Chrome 56.0.2924 (Mac OS X 10.12.3)
Error: Error in ./homePage class homePage - inline template:62:6 caused by: Cannot read property 'removeAttribute' of undefined
TypeError: Cannot read property 'removeAttribute' of undefined
at cleanupStyles (webpack:///
/ionic-angular/components/slides/swiper/swiper.js:797:0 <- src/test.ts:28038:16)/ionic-angular/components/slides/swiper/swiper.js:831:0 <- src/test.ts:28072:5)at destroySwiper (webpack:///
at Slides.ngOnDestroy (webpack:///
/ionic-angular/components/slides/slides.js:914:0 <- src/test.ts:44412:101)/@angular/core/src/linker/view.js:143:0 <- src/test.ts:82548:14)at Wrapper_Slides.ngOnDestroy (/IonicModule/Slides/wrapper.ngfactory.js:27:16)
at CompiledTemplate.proxyViewClass.View_homePage0.destroyInternal (/DynamicTestModule/homePage/component.ngfactory.js:501:21)
at CompiledTemplate.proxyViewClass.AppView.destroy (webpack:///
at CompiledTemplate.proxyViewClass.DebugAppView.destroy (webpack:///
/@angular/core/src/linker/view.js:371:0 <- src/test.ts:82776:38)/@angular/core/src/linker/view.js:143:0 <- src/test.ts:82548:14)at CompiledTemplate.proxyViewClass.View_homePage_Host0.destroyInternal (/DynamicTestModule/homePage/host.ngfactory.js:33:19)
at CompiledTemplate.proxyViewClass.AppView.destroy (webpack:///
at CompiledTemplate.proxyViewClass.DebugAppView.destroy (webpack:///~/@angular/core/src/linker/view.js:371:0 <- src/test.ts:82776:38)
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.8.6
ios-sim version: 5.0.11
OS: macOS Sierra
Node Version: v6.9.0
Xcode version: Xcode 8.1 Build version 8B62
The text was updated successfully, but these errors were encountered: