Skip to content

Commit 72ceb91

Browse files
committed
commit test update #1638
1 parent 5c03282 commit 72ceb91

File tree

1 file changed

+2
-34
lines changed

1 file changed

+2
-34
lines changed

src/test/js/spec/SpeciesViewModelSpec.js

+2-34
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
describe("SpeciesViewModel Spec", function () {
22
var request, result;
3-
// jasmine.Ajax.install();
4-
5-
// beforeEach(function() {
6-
// request = jasmine.Ajax.requests.mostRecent();
7-
// expect(request.method).toBe('GET');
8-
// });
93
it("Can participate in the DataModelItem calls like checkWarnings", function () {
104
var options = {
115
searchBieUrl: '/species/searchBie'
@@ -31,7 +25,7 @@ describe("SpeciesViewModel Spec", function () {
3125

3226
});
3327

34-
describe("Test outputSpeciesId", function () {
28+
describe("Test ajax call to supply new outSpeciesId", function () {
3529
beforeEach(function() {
3630
jasmine.Ajax.install();
3731
});
@@ -54,32 +48,10 @@ describe("SpeciesViewModel Spec", function () {
5448
guid: 'New guid'
5549
};
5650

57-
5851
let options = {searchBieUrl: '/test/searchBie', bieUrl: '/test/bie/', getOutputSpeciesIdUrl: 'test/getOutputSpeciesIdUrl'}
5952
let responseData = {outputSpeciesId: "666666"};
6053

61-
// spyOn($, 'ajax').and.callFake(function () {
62-
// var d = $.Deferred();
63-
// d.resolve(responseData);
64-
// return d.promise();
65-
// });
66-
67-
68-
69-
70-
7154
let speciesViewModel = new SpeciesViewModel(oldSpeciesSelectedData, options, {});
72-
// spyOn($, 'ajax').and.callFake(function () {
73-
// var d = $.Deferred();
74-
// d.resolve(responseData);
75-
// return d.promise();
76-
// });
77-
78-
// request = jasmine.Ajax.requests.mostRecent();
79-
// request.respondWith({
80-
// status: 200,
81-
// responseJSON: responseData
82-
// });
8355

8456
speciesViewModel.loadData(newSpeciesSelectedData);
8557
request = jasmine.Ajax.requests.filter('test/getOutputSpeciesIdUrl')[0];
@@ -88,13 +60,9 @@ describe("SpeciesViewModel Spec", function () {
8860
responseJSON: responseData
8961
});
9062

91-
92-
// expect(request.url).toBe('test/getOutputSpeciesIdUrl');
63+
expect(request.url).toBe('test/getOutputSpeciesIdUrl');
9364
expect(speciesViewModel.toJS().outputSpeciesId).toEqual(responseData.outputSpeciesId)
94-
9565
expect(speciesViewModel.outputSpeciesId()).not.toEqual(oldSpeciesSelectedData.outputSpeciesId);
96-
// expect($.ajax).toHaveBeenCalled();
97-
// expect(speciesViewModel.toJS().outputSpeciesId).toEqual(responseData.outputSpeciesId);
9866

9967
});
10068
})

0 commit comments

Comments
 (0)