Files
edx-platform/common/static/js/spec/jquery.immediateDescendents_spec.js
Michael Terry a34c8c8233 Drop remaining coffee use
This basically commits the transpiled CoffeeScript JS (with minor
cleanup) and removes coffee build support.

A tiny amount of support for xblocks exists, because external users
may have xblocks with coffee. But no coffee in our tree anyway.
2018-04-13 14:10:40 -04:00

33 lines
794 B
JavaScript

describe("$.immediateDescendents", function() {
beforeEach(function() {
setFixtures(`\
<div>
<div class='xblock' id='child'>
<div class='xblock' id='nested'/>
</div>
<div>
<div class='xblock' id='grandchild'/>
</div>
</div>\
`
);
this.descendents = $('#jasmine-fixtures').immediateDescendents(".xblock").get();
});
it("finds non-immediate children", function() {
expect(this.descendents).toContain($('#grandchild').get(0));
});
it("finds immediate children", function() {
expect(this.descendents).toContain($('#child').get(0));
});
it("skips nested descendents", function() {
expect(this.descendents).not.toContain($('#nested').get(0));
});
it("finds 2 children", function() {
expect(this.descendents.length).toBe(2);
});
});