CoffeeScript tests migration: Decaffeinate files
This is running decaffeinate, with no additional cleanup.
This commit is contained in:
committed by
Calen Pennington
parent
5c64da2f63
commit
0880502f26
@@ -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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user