Skip to content

Commit

Permalink
commit test update #1638
Browse files Browse the repository at this point in the history
  • Loading branch information
salomon-j committed Oct 14, 2024
1 parent 5c03282 commit 72ceb91
Showing 1 changed file with 2 additions and 34 deletions.
36 changes: 2 additions & 34 deletions src/test/js/spec/SpeciesViewModelSpec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
describe("SpeciesViewModel Spec", function () {
var request, result;
// jasmine.Ajax.install();

// beforeEach(function() {
// request = jasmine.Ajax.requests.mostRecent();
// expect(request.method).toBe('GET');
// });
it("Can participate in the DataModelItem calls like checkWarnings", function () {
var options = {
searchBieUrl: '/species/searchBie'
Expand All @@ -31,7 +25,7 @@ describe("SpeciesViewModel Spec", function () {

});

describe("Test outputSpeciesId", function () {
describe("Test ajax call to supply new outSpeciesId", function () {
beforeEach(function() {
jasmine.Ajax.install();
});
Expand All @@ -54,32 +48,10 @@ describe("SpeciesViewModel Spec", function () {
guid: 'New guid'
};


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

// spyOn($, 'ajax').and.callFake(function () {
// var d = $.Deferred();
// d.resolve(responseData);
// return d.promise();
// });





let speciesViewModel = new SpeciesViewModel(oldSpeciesSelectedData, options, {});
// spyOn($, 'ajax').and.callFake(function () {
// var d = $.Deferred();
// d.resolve(responseData);
// return d.promise();
// });

// request = jasmine.Ajax.requests.mostRecent();
// request.respondWith({
// status: 200,
// responseJSON: responseData
// });

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


// expect(request.url).toBe('test/getOutputSpeciesIdUrl');
expect(request.url).toBe('test/getOutputSpeciesIdUrl');
expect(speciesViewModel.toJS().outputSpeciesId).toEqual(responseData.outputSpeciesId)

expect(speciesViewModel.outputSpeciesId()).not.toEqual(oldSpeciesSelectedData.outputSpeciesId);
// expect($.ajax).toHaveBeenCalled();
// expect(speciesViewModel.toJS().outputSpeciesId).toEqual(responseData.outputSpeciesId);

});
})
Expand Down

0 comments on commit 72ceb91

Please sign in to comment.