-
Notifications
You must be signed in to change notification settings - Fork 162
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(the-video-controller): fix some UI bugs #192
Conversation
Add mouseenter, hideVolume, hideProgressBar timer unit tests.
1. Add isValidClick helper function, show mousedown/up/click's validity. 2. Add isValidClick to mousedown.left and mouseup.left.
Codecov Report
@@ Coverage Diff @@
## develop #192 +/- ##
===========================================
+ Coverage 62.01% 63.19% +1.18%
===========================================
Files 48 48
Lines 2364 2372 +8
Branches 301 300 -1
===========================================
+ Hits 1466 1499 +33
+ Misses 778 757 -21
+ Partials 120 116 -4
Continue to review full report at Codecov.
|
import Titlebar from '../Titlebar.vue'; | ||
import PlayButton from './PlayButton.vue'; | ||
import VolumeControl from './VolumeControl'; | ||
import AdvanceControl from './AdvanceControl'; | ||
import SubtitleControl from './SubtitleControl'; | ||
import TheTimeCodes from './TheTimeCodes'; | ||
import TimeProgressBar from './TimeProgressBar.vue'; | ||
import TimeProgressBar from './TimeProgressBar'; |
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.
这里为什么会去掉 .vue 呢?
貌似用 vscode 的话不带 .vue 无法识别
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.
我试了下没有.vue
我这边没问题,但是这个链接说把所有的拓展名加上去会更好一点。
要不要把所有的拓展名(.js
, .vue
)都加上去呢。
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.
我个人习惯是不带,这样如果有 js 迁移到 ts 这种操作只要改下文件名就好,不用改代码。另一个场景是类似 React Native 或者 Meteor 里的代码可能会跨多个平台,这样写 import * from 'index'
可以在不同平台下分别映射到 index.ios.js
, index.android.js
, index.server.js
不过我们这个项目不太会有这样的情况,而且 vue 也是个比较特殊的格式,里面包括了多种类型的内容,可以都带上扩展名。
反正约定统一就好~
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.
那我先把这个文件内部的import全部加上拓展名了。
this.timerManager.updateTimer('mouseStopMoving', this.mousestopDelay, false); | ||
this.mouseStopMoving = false; | ||
} | ||
this.mouseStopMoving = currentPosition === lastPosition; |
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.
这里用深比较会不会合理点?好像没有看到单独设置 position 的地方,浅比较 position 相同的话 currentEventInfo.get('mousemove') 和 lastEventInfo.get('mousemove') 也是相同的吧
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.
对的,用深比较会更合理。那我再加上一句/* eslint-disable eqeqeq */么,好像规则不太想用==
。
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.
==
不是深比较啊 - -||
{a:1} == {a:1}
也是 false
的。深比较是指 ({a:1}).a === ({a:1}).a
这种
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.
好的
我这里没什么问题,OK的。 |
TheVideoController
's test coverage to 84.62%.PlayButton
.