Skip to content

jQueryMobile読み込み時、テストケース『h5track*イベントハンドラを、touchイベントのトリガで発火させたときにcontext.evArgに引数が格納されること。』が失敗する #142

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

Closed
fukudayasuo opened this issue Dec 27, 2012 · 2 comments
Assignees
Milestone

Comments

@fukudayasuo
Copy link

Timeoutとなり、touchmoveのトリガで実行されるはずのアサートが実行されていない。

@ghost ghost assigned fukudayasuo Dec 27, 2012
@fukudayasuo
Copy link
Author

テストコードに問題があります。

jQueryMobileがロードされている時、documentのtouch系イベントにjQueryMobileがハンドラをバインドしています。
テストケース内で

$elm.trigger('touchmove');

としていますが、この時JQMのバインドしたハンドラが動作します。JQMのバインドしたハンドラ内で、イベントオブジェクトのevent.touches[0]を参照していますが、トリガでイベント名だけで読んだ場合にtouchesプロパティが入っていないため、エラーが起きてテストが止まってしまいます。

テストケース内でtouchイベントをトリガする際に、イベント名ではなく、イベントオブジェクトを生成してトリガすれば回避できると思われます。

fukudayasuo pushed a commit to hifive-labs/hifivemain that referenced this issue Jan 7, 2013
@simdy
Copy link
Member

simdy commented Jan 7, 2013

コードリファクタ:
91a454a

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

No branches or pull requests

2 participants