Merge pull request #15846 from edx/ormsbee/decaffeinate_tests_2

WIP: Decaffeinate Test Files (Part 2)
This commit is contained in:
Calen Pennington
2017-11-28 13:34:26 -05:00
committed by GitHub
65 changed files with 6951 additions and 6015 deletions

View File

@@ -1 +0,0 @@
*.js

View File

@@ -1,26 +0,0 @@
describe "$.immediateDescendents", ->
beforeEach ->
setFixtures """
<div>
<div class='xblock' id='child'>
<div class='xblock' id='nested'/>
</div>
<div>
<div class='xblock' id='grandchild'/>
</div>
</div>
"""
@descendents = $('#jasmine-fixtures').immediateDescendents(".xblock").get()
it "finds non-immediate children", ->
expect(@descendents).toContain($('#grandchild').get(0))
it "finds immediate children", ->
expect(@descendents).toContain($('#child').get(0))
it "skips nested descendents", ->
expect(@descendents).not.toContain($('#nested').get(0))
it "finds 2 children", ->
expect(@descendents.length).toBe(2)

View File

@@ -0,0 +1,33 @@
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);
});
});