CoffeeScript tests migration: Decaffeinate files

This is running decaffeinate, with no additional cleanup.
This commit is contained in:
David Ormsbee
2017-08-17 20:09:37 -04:00
committed by Calen Pennington
parent 5c64da2f63
commit 0880502f26
30 changed files with 5897 additions and 4850 deletions

View File

@@ -1,26 +1,38 @@
describe "$.immediateDescendents", ->
beforeEach ->
setFixtures """
<div>
<div class='xblock' id='child'>
<div class='xblock' id='nested'/>
</div>
<div>
<div class='xblock' id='grandchild'/>
</div>
</div>
"""
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
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>\
`
);
@descendents = $('#jasmine-fixtures').immediateDescendents(".xblock").get()
return this.descendents = $('#jasmine-fixtures').immediateDescendents(".xblock").get();
});
it "finds non-immediate children", ->
expect(@descendents).toContain($('#grandchild').get(0))
it("finds non-immediate children", function() {
return expect(this.descendents).toContain($('#grandchild').get(0));
});
it "finds immediate children", ->
expect(@descendents).toContain($('#child').get(0))
it("finds immediate children", function() {
return expect(this.descendents).toContain($('#child').get(0));
});
it "skips nested descendents", ->
expect(@descendents).not.toContain($('#nested').get(0))
it("skips nested descendents", function() {
return expect(this.descendents).not.toContain($('#nested').get(0));
});
it "finds 2 children", ->
expect(@descendents.length).toBe(2)
return it("finds 2 children", function() {
return expect(this.descendents.length).toBe(2);
});
});