This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
130 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import { moduleFor, test } from 'ember-qunit'; | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
moduleFor('adapter:application', 'Unit | Adapter | application', { | ||
integration: true | ||
}); | ||
module('Unit | Adapter | application', function(hooks) { | ||
setupTest(hooks); | ||
|
||
// Replace this with your real tests. | ||
test('buildQuery appends page size', function(assert) { | ||
let adapter = this.subject(); | ||
assert.deepEqual(adapter.buildQuery({}), { "page": { "size": 0 } }); | ||
assert.deepEqual(adapter.buildQuery({"include": "sources"}), { "include": "sources", "page": { "size": 0 } }); | ||
// Replace this with your real tests. | ||
test('buildQuery appends page size', function(assert) { | ||
let adapter = this.owner.lookup('adapter:application'); | ||
assert.deepEqual(adapter.buildQuery({}), { "page": { "size": 0 } }); | ||
assert.deepEqual(adapter.buildQuery({"include": "sources"}), { "include": "sources", "page": { "size": 0 } }); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,75 @@ | ||
import { moduleFor, test } from 'ember-qunit'; | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
moduleFor('controller:index', 'Unit | Controller | index', { | ||
integration: true | ||
}); | ||
module('Unit | Controller | index', function(hooks) { | ||
setupTest(hooks); | ||
|
||
// Replace this with your real tests. | ||
test('it exists', function(assert) { | ||
let controller = this.subject(); | ||
assert.ok(controller); | ||
}); | ||
// Replace this with your real tests. | ||
test('it exists', function(assert) { | ||
let controller = this.owner.lookup('controller:index'); | ||
assert.ok(controller); | ||
}); | ||
|
||
test('works are sorted by author', function(assert) { | ||
let controller = this.subject(); | ||
controller.set('model', [ | ||
{"id": "1", "author": "Bob", "bookpuller": null, "comments": null, "issue": "2", "title": "Res Ipsa Loquitur", "volume": "2018"}, | ||
{"id": "2", "author": "Alice", "bookpuller": null, "comments": null, "issue": "1", "title": "In Vino Veritas", "volume": "2018"} | ||
]); | ||
test('works are sorted by author', function(assert) { | ||
let controller = this.owner.lookup('controller:index'); | ||
controller.set('model', [ | ||
{"id": "1", "author": "Bob", "bookpuller": null, "comments": null, "issue": "2", "title": "Res Ipsa Loquitur", "volume": "2018"}, | ||
{"id": "2", "author": "Alice", "bookpuller": null, "comments": null, "issue": "1", "title": "In Vino Veritas", "volume": "2018"} | ||
]); | ||
|
||
assert.deepEqual(controller.get('sorted'), [ | ||
{"id": "2", "author": "Alice", "bookpuller": null, "comments": null, "issue": "1", "title": "In Vino Veritas", "volume": "2018"}, | ||
{"id": "1", "author": "Bob", "bookpuller": null, "comments": null, "issue": "2", "title": "Res Ipsa Loquitur", "volume": "2018"} | ||
]); | ||
}); | ||
assert.deepEqual(controller.get('sorted'), [ | ||
{"id": "2", "author": "Alice", "bookpuller": null, "comments": null, "issue": "1", "title": "In Vino Veritas", "volume": "2018"}, | ||
{"id": "1", "author": "Bob", "bookpuller": null, "comments": null, "issue": "2", "title": "Res Ipsa Loquitur", "volume": "2018"} | ||
]); | ||
}); | ||
|
||
test('works are sorted by title', function(assert) { | ||
let controller = this.subject(); | ||
controller.set('model', [ | ||
{"id": "1", "author": "Bob", "bookpuller": null, "comments": null, "issue": "2", "title": "Res Ipsa Loquitur", "volume": "2018"}, | ||
{"id": "3", "author": "Eve", "bookpuller": "Jack", "comments": "Hi", "issue": "5", "title": "Veni Vedi Vici", "volume": "2017"}, | ||
{"id": "2", "author": "Alice", "bookpuller": null, "comments": null, "issue": "1", "title": "In Vino Veritas", "volume": "2018"} | ||
]); | ||
test('works are sorted by title', function(assert) { | ||
let controller = this.owner.lookup('controller:index'); | ||
controller.set('model', [ | ||
{"id": "1", "author": "Bob", "bookpuller": null, "comments": null, "issue": "2", "title": "Res Ipsa Loquitur", "volume": "2018"}, | ||
{"id": "3", "author": "Eve", "bookpuller": "Jack", "comments": "Hi", "issue": "5", "title": "Veni Vedi Vici", "volume": "2017"}, | ||
{"id": "2", "author": "Alice", "bookpuller": null, "comments": null, "issue": "1", "title": "In Vino Veritas", "volume": "2018"} | ||
]); | ||
|
||
controller.send('changesort', 'title'); | ||
assert.deepEqual(controller.get('sorted'), [ | ||
{"id": "2", "author": "Alice", "bookpuller": null, "comments": null, "issue": "1", "title": "In Vino Veritas", "volume": "2018"}, | ||
{"id": "1", "author": "Bob", "bookpuller": null, "comments": null, "issue": "2", "title": "Res Ipsa Loquitur", "volume": "2018"}, | ||
{"id": "3", "author": "Eve", "bookpuller": "Jack", "comments": "Hi", "issue": "5", "title": "Veni Vedi Vici", "volume": "2017"} | ||
]); | ||
}); | ||
controller.send('changesort', 'title'); | ||
assert.deepEqual(controller.get('sorted'), [ | ||
{"id": "2", "author": "Alice", "bookpuller": null, "comments": null, "issue": "1", "title": "In Vino Veritas", "volume": "2018"}, | ||
{"id": "1", "author": "Bob", "bookpuller": null, "comments": null, "issue": "2", "title": "Res Ipsa Loquitur", "volume": "2018"}, | ||
{"id": "3", "author": "Eve", "bookpuller": "Jack", "comments": "Hi", "issue": "5", "title": "Veni Vedi Vici", "volume": "2017"} | ||
]); | ||
}); | ||
|
||
test('works are sorted by issue', function(assert) { | ||
let controller = this.subject(); | ||
controller.set('model', [ | ||
{"id": "1", "author": "Bob", "bookpuller": null, "comments": null, "issue": "2", "title": "Res Ipsa Loquitur", "volume": "2018"}, | ||
{"id": "3", "author": "Eve", "bookpuller": "Jack", "comments": "Hi", "issue": "5", "title": "Veni Vedi Vici", "volume": "2017"}, | ||
{"id": "2", "author": "Alice", "bookpuller": null, "comments": null, "issue": "1", "title": "In Vino Veritas", "volume": "2018"} | ||
]); | ||
test('works are sorted by issue', function(assert) { | ||
let controller = this.owner.lookup('controller:index'); | ||
controller.set('model', [ | ||
{"id": "1", "author": "Bob", "bookpuller": null, "comments": null, "issue": "2", "title": "Res Ipsa Loquitur", "volume": "2018"}, | ||
{"id": "3", "author": "Eve", "bookpuller": "Jack", "comments": "Hi", "issue": "5", "title": "Veni Vedi Vici", "volume": "2017"}, | ||
{"id": "2", "author": "Alice", "bookpuller": null, "comments": null, "issue": "1", "title": "In Vino Veritas", "volume": "2018"} | ||
]); | ||
|
||
controller.send('changesort', 'issue'); | ||
assert.deepEqual(controller.get('sorted'), [ | ||
{"id": "2", "author": "Alice", "bookpuller": null, "comments": null, "issue": "1", "title": "In Vino Veritas", "volume": "2018"}, | ||
{"id": "1", "author": "Bob", "bookpuller": null, "comments": null, "issue": "2", "title": "Res Ipsa Loquitur", "volume": "2018"}, | ||
{"id": "3", "author": "Eve", "bookpuller": "Jack", "comments": "Hi", "issue": "5", "title": "Veni Vedi Vici", "volume": "2017"} | ||
]); | ||
}); | ||
controller.send('changesort', 'issue'); | ||
assert.deepEqual(controller.get('sorted'), [ | ||
{"id": "2", "author": "Alice", "bookpuller": null, "comments": null, "issue": "1", "title": "In Vino Veritas", "volume": "2018"}, | ||
{"id": "1", "author": "Bob", "bookpuller": null, "comments": null, "issue": "2", "title": "Res Ipsa Loquitur", "volume": "2018"}, | ||
{"id": "3", "author": "Eve", "bookpuller": "Jack", "comments": "Hi", "issue": "5", "title": "Veni Vedi Vici", "volume": "2017"} | ||
]); | ||
}); | ||
|
||
test('works are reverse sorted by bookpuller', function(assert) { | ||
let controller = this.subject(); | ||
controller.set('model', [ | ||
{"id": "1", "author": "Bob", "bookpuller": null, "comments": null, "issue": "2", "title": "Res Ipsa Loquitur", "volume": "2018"}, | ||
{"id": "3", "author": "Eve", "bookpuller": "Jack", "comments": "Hi", "issue": "5", "title": "Veni Vedi Vici", "volume": "2017"}, | ||
{"id": "2", "author": "Alice", "bookpuller": null, "comments": null, "issue": "1", "title": "In Vino Veritas", "volume": "2018"} | ||
]); | ||
test('works are reverse sorted by bookpuller', function(assert) { | ||
let controller = this.owner.lookup('controller:index'); | ||
controller.set('model', [ | ||
{"id": "1", "author": "Bob", "bookpuller": null, "comments": null, "issue": "2", "title": "Res Ipsa Loquitur", "volume": "2018"}, | ||
{"id": "3", "author": "Eve", "bookpuller": "Jack", "comments": "Hi", "issue": "5", "title": "Veni Vedi Vici", "volume": "2017"}, | ||
{"id": "2", "author": "Alice", "bookpuller": null, "comments": null, "issue": "1", "title": "In Vino Veritas", "volume": "2018"} | ||
]); | ||
|
||
controller.send('changesort', 'bookpuller'); | ||
controller.send('changesort', 'bookpuller'); | ||
controller.send('changesort', 'bookpuller'); | ||
controller.send('changesort', 'bookpuller'); | ||
|
||
assert.deepEqual(controller.get('sorted'), [ | ||
{"id": "3", "author": "Eve", "bookpuller": "Jack", "comments": "Hi", "issue": "5", "title": "Veni Vedi Vici", "volume": "2017"}, | ||
{"id": "1", "author": "Bob", "bookpuller": null, "comments": null, "issue": "2", "title": "Res Ipsa Loquitur", "volume": "2018"}, | ||
{"id": "2", "author": "Alice", "bookpuller": null, "comments": null, "issue": "1", "title": "In Vino Veritas", "volume": "2018"} | ||
]); | ||
assert.deepEqual(controller.get('sorted'), [ | ||
{"id": "3", "author": "Eve", "bookpuller": "Jack", "comments": "Hi", "issue": "5", "title": "Veni Vedi Vici", "volume": "2017"}, | ||
{"id": "1", "author": "Bob", "bookpuller": null, "comments": null, "issue": "2", "title": "Res Ipsa Loquitur", "volume": "2018"}, | ||
{"id": "2", "author": "Alice", "bookpuller": null, "comments": null, "issue": "1", "title": "In Vino Veritas", "volume": "2018"} | ||
]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,38 @@ | ||
import { moduleFor, test } from 'ember-qunit'; | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
moduleFor('controller:work/sources', 'Unit | Controller | work/sources', { | ||
integration: true | ||
}); | ||
module('Unit | Controller | work/sources', function(hooks) { | ||
setupTest(hooks); | ||
|
||
test('sources are filtered', function(assert) { | ||
let controller = this.subject(); | ||
controller.set('model', [ | ||
{"id": "1", "citation": "New York Times", "comments": null, "ordered": null, "status": "N", "type": "P", "url": "null"}, | ||
{"id": "2", "citation": "Blackstone's Commentaries", "comments": null, "ordered": null, "status": "N", "type": "B", "url": "null"}, | ||
{"id": "3", "citation": "Roe v. Wade", "comments": null, "ordered": null, "status": "N", "type": "C", "url": "null"}, | ||
{"id": "4", "citation": "U. Ill. L. Rev.", "comments": null, "ordered": null, "status": "N", "type": "J", "url": "null"}, | ||
{"id": "5", "citation": "H.R. 5", "comments": null, "ordered": null, "status": "N", "type": "L", "url": "null"}, | ||
{"id": "6", "citation": "Zombo.com", "comments": null, "ordered": null, "status": "N", "type": "M", "url": "null"} | ||
]); | ||
test('sources are filtered', function(assert) { | ||
let controller = this.owner.lookup('controller:work/sources'); | ||
controller.set('model', [ | ||
{"id": "1", "citation": "New York Times", "comments": null, "ordered": null, "status": "N", "type": "P", "url": "null"}, | ||
{"id": "2", "citation": "Blackstone's Commentaries", "comments": null, "ordered": null, "status": "N", "type": "B", "url": "null"}, | ||
{"id": "3", "citation": "Roe v. Wade", "comments": null, "ordered": null, "status": "N", "type": "C", "url": "null"}, | ||
{"id": "4", "citation": "U. Ill. L. Rev.", "comments": null, "ordered": null, "status": "N", "type": "J", "url": "null"}, | ||
{"id": "5", "citation": "H.R. 5", "comments": null, "ordered": null, "status": "N", "type": "L", "url": "null"}, | ||
{"id": "6", "citation": "Zombo.com", "comments": null, "ordered": null, "status": "N", "type": "M", "url": "null"} | ||
]); | ||
|
||
assert.deepEqual(controller.get('books'), [ | ||
{"id": "2", "citation": "Blackstone's Commentaries", "comments": null, "ordered": null, "status": "N", "type": "B", "url": "null"} | ||
]); | ||
assert.deepEqual(controller.get('books'), [ | ||
{"id": "2", "citation": "Blackstone's Commentaries", "comments": null, "ordered": null, "status": "N", "type": "B", "url": "null"} | ||
]); | ||
|
||
assert.deepEqual(controller.get('cases'), [ | ||
{"id": "3", "citation": "Roe v. Wade", "comments": null, "ordered": null, "status": "N", "type": "C", "url": "null"}, | ||
]); | ||
assert.deepEqual(controller.get('journals'), [ | ||
{"id": "4", "citation": "U. Ill. L. Rev.", "comments": null, "ordered": null, "status": "N", "type": "J", "url": "null"}, | ||
]); | ||
assert.deepEqual(controller.get('legislative'), [ | ||
{"id": "5", "citation": "H.R. 5", "comments": null, "ordered": null, "status": "N", "type": "L", "url": "null"} | ||
]); | ||
assert.deepEqual(controller.get('miscellaneous'), [ | ||
{"id": "6", "citation": "Zombo.com", "comments": null, "ordered": null, "status": "N", "type": "M", "url": "null"} | ||
]); | ||
assert.deepEqual(controller.get('periodicals'), [ | ||
{"id": "1", "citation": "New York Times", "comments": null, "ordered": null, "status": "N", "type": "P", "url": "null"} | ||
]); | ||
assert.deepEqual(controller.get('cases'), [ | ||
{"id": "3", "citation": "Roe v. Wade", "comments": null, "ordered": null, "status": "N", "type": "C", "url": "null"}, | ||
]); | ||
assert.deepEqual(controller.get('journals'), [ | ||
{"id": "4", "citation": "U. Ill. L. Rev.", "comments": null, "ordered": null, "status": "N", "type": "J", "url": "null"}, | ||
]); | ||
assert.deepEqual(controller.get('legislative'), [ | ||
{"id": "5", "citation": "H.R. 5", "comments": null, "ordered": null, "status": "N", "type": "L", "url": "null"} | ||
]); | ||
assert.deepEqual(controller.get('miscellaneous'), [ | ||
{"id": "6", "citation": "Zombo.com", "comments": null, "ordered": null, "status": "N", "type": "M", "url": "null"} | ||
]); | ||
assert.deepEqual(controller.get('periodicals'), [ | ||
{"id": "1", "citation": "New York Times", "comments": null, "ordered": null, "status": "N", "type": "P", "url": "null"} | ||
]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import { moduleFor, test } from 'ember-qunit'; | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
moduleFor('route:index', 'Unit | Route | index', { | ||
integration: true | ||
}); | ||
module('Unit | Route | index', function(hooks) { | ||
setupTest(hooks); | ||
|
||
test('it exists', function(assert) { | ||
let route = this.subject(); | ||
assert.ok(route); | ||
test('it exists', function(assert) { | ||
let route = this.owner.lookup('route:index'); | ||
assert.ok(route); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import { moduleFor, test } from 'ember-qunit'; | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
moduleFor('route:work', 'Unit | Route | work', { | ||
integration: true | ||
}); | ||
module('Unit | Route | work', function(hooks) { | ||
setupTest(hooks); | ||
|
||
test('it exists', function(assert) { | ||
let route = this.subject(); | ||
assert.ok(route); | ||
test('it exists', function(assert) { | ||
let route = this.owner.lookup('route:work'); | ||
assert.ok(route); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
import { moduleFor, test } from 'ember-qunit'; | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
moduleFor('route:work/sources', 'Unit | Route | work/sources', { | ||
integration: true | ||
}); | ||
module('Unit | Route | work/sources', function(hooks) { | ||
setupTest(hooks); | ||
|
||
test('it exists', function(assert) { | ||
let route = this.subject(); | ||
assert.ok(route); | ||
test('it exists', function(assert) { | ||
let route = this.owner.lookup('route:work/sources'); | ||
assert.ok(route); | ||
}); | ||
}); |