jQuery 是否有经过适当测试的 Select2 或 Chosen 替代品?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15544693/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there a properly tested alternative to Select2 or Chosen?
提问by Joseph Tura
I am looking for an alternative to Select2 that basically provides the same functionality, but includes proper tests.
我正在寻找 Select2 的替代品,它基本上提供相同的功能,但包括适当的测试。
The quest for the holy grail? The last unicorn?
追求圣杯?最后一只独角兽?
回答by brianreavis
Selectize.jsis a select2 alternative I've been working on that has a suite of tests using a combination of testem, syn, mocha, and chai. Right now there are the following classes of tests:
Selectize.js是我一直在研究的 select2 替代方案,它有一套使用testem、syn、mocha和chai组合的测试。现在有以下几类测试:
- Interaction
Functional tests that makes sure the control behaves as if the user is using it (using syn). - Setup
Ensures the control can be initialized properly from existing<select>
and<input>
elements. - API
Tests core API methods for proper functionality. - Events
Ensures built-in events get fired at the right times with the proper arguments. - XSS
Tests a handful of potential exploits.
- 交互
功能测试,确保控件的行为就像用户正在使用它一样(使用syn)。 - 设置
确保控件可以从现有<select>
和<input>
元素正确初始化。 - API
测试核心 API 方法的正确功能。 - 事件
确保内置事件在正确的时间使用正确的参数被触发。 - XSS
测试一些潜在的漏洞利用。
With that said, the tests aren't as expansive as I want them to be, but it's getting there :)
话虽如此,测试并不像我希望的那样广泛,但它正在实现:)
回答by gustavohenke
回答by tanguy_k
Another possible alternative is bootstrap-multiselect
另一种可能的选择是bootstrap-multiselect
"JQuery multiselect plugin based on Twitter Bootstrap"
《基于 Twitter Bootstrap 的 JQuery 多选插件》
Examples and documentation: http://davidstutz.github.io/bootstrap-multiselect/
示例和文档:http: //davidstutz.github.io/bootstrap-multiselect/
- The repository does not contain any automated tests, manual testsinstead
- Themed using Bootstrap 3
- JavaScript source code is short: 800 lines of code
- 524 stars on GitHub (as of 2013/12/13)
- 存储库不包含任何自动化测试,而是手动测试
- 主题使用 Bootstrap 3
- JavaScript 源代码很短:800 行代码
- GitHub 上的 524 颗星(截至 2013/12/13)