Skip to content

Commit

Permalink
Merge pull request #12 from jdecool/test-select2-no-search-input
Browse files Browse the repository at this point in the history
Add tests for select2 context when search input is disable
  • Loading branch information
jdecool committed Jan 4, 2016
2 parents b564ce4 + 880721f commit 33d27d7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/features/fr/select2.feature
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ Fonctionnalité: Select2 Feature
Etant donné je suis sur "/select2-multiple.html"
Alors je remplis le champs select2 "Two" pour "select_number2"
Et je remplis le champs select2 "Three" pour "select_number2"

@javascript
Scénario:
Etant donné je suis sur "/select2-nosearch.html"
Alors je remplis le champs select2 "Thirteen" pour "select_number"
5 changes: 5 additions & 0 deletions tests/features/select2.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ Feature: Select2 Feature
Given I am on "/select2-multiple.html"
Then I fill in select2 "Two" for "select_number2"
And I fill in select2 "Three" for "select_number2"

@javascript
Scenario:
Given I am on "/select2-nosearch.html"
Then I fill in select2 "Thirteen" for "select_number"
26 changes: 26 additions & 0 deletions tests/fixtures/select2-nosearch.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<html>
<head>
<link href="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0-rc.2/css/select2.min.css" rel="stylesheet" />
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0-rc.2/js/select2.min.js"></script>
</head>
<body>
<select id="select_number" name="select_number">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
<option value="4">Four</option>
<option value="5">Five</option>
<option value="6">Six</option>
<option value="7">Seven</option>
<option value="8">Height</option>
<option value="9">Nine</option>
<option value="10">Ten</option>
<option value="11">Eleven</option>
<option value="12">Twelve</option>
<option value="13">Thirteen</option>
</select>

<script type="text/javascript">$('#select_number').select2({ minimumResultsForSearch: Infinity });</script>
</body>
</html>

0 comments on commit 33d27d7

Please sign in to comment.