Skip to content

Commit

Permalink
Unit test for version number url passing on fetchRawDef
Browse files Browse the repository at this point in the history
  • Loading branch information
philrenaud committed Nov 10, 2024
1 parent ff5374e commit 3d532cf
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions ui/tests/unit/adapters/job-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,25 @@ module('Unit | Adapter | Job', function (hooks) {
'/v1/job/job-id/submission?namespace=zoey&version=job-version'
);
});
test('Requests for specific versions include the queryParam', async function (assert) {
const adapter = this.owner.lookup('adapter:job');
const job = {
get: sinon.stub(),
};

// Stub the ajax method to avoid making real API calls
sinon.stub(adapter, 'ajax').callsFake(() => resolve({}));

await adapter.fetchRawSpecification(job, 99);

assert.ok(adapter.ajax.calledOnce, 'The ajax method is called once');
assert.equal(
adapter.ajax.args[0][0],
'/v1/job/job-id/submission?version=99',
'it includes the version query param'
);
assert.equal(adapter.ajax.args[0][1], 'GET');
});
});
});

Expand Down

0 comments on commit 3d532cf

Please sign in to comment.