Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zoltantothcom committed Jul 23, 2022
1 parent 48590ef commit 813ff66
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ var fixturePath = 'base/test/spec/fixtures',
selectFixtureWithId = 'select_id.fixture.html',
selectFixtureWithoutId = 'select_no_id.fixture.html',
selectFixtureWithOptgroup = 'select_optgroup.fixture.html';
selectFixtureWithDisabled = 'select_disabled.fixture.html';
17 changes: 17 additions & 0 deletions test/spec/dropdown.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,23 @@ describe('SELECT - supports event bubbling', function() {
});
});

describe('SELECT - contains disabled item', function() {
beforeEach(function() {
jasmine.getFixtures().fixturesPath = fixturePath;
loadFixtures(selectFixtureWithDisabled);

this.original = document.getElementById('select');

this.select = new CustomSelect({
elem: this.original,
});
});

it('should have a disabled class', function() {
expect($('ul.js-Dropdown-list li:first-child')).toHaveClass('is-disabled');
});
});

function sharedTests() {
describe('original select', function() {
it('markup should be present', function() {
Expand Down
7 changes: 7 additions & 0 deletions test/spec/fixtures/select_disabled.fixture.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<select id="select">
<option value="pigeon" disabled>Pigeon</option>
<option value="hummingbird">Hummingbird</option>
<option value="crane">Crane</option>
<option value="penguin" selected>Penguin</option>
<option value="eagle">Eagle</option>
</select>

0 comments on commit 813ff66

Please sign in to comment.