Merge pull request #4023 from hashicorp/b-ui-index-1

UI: The initial index qp value should be 1, not 0
This commit is contained in:
Michael Lange 2018-03-21 22:58:10 -07:00 committed by GitHub
commit bac8511267
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

@ -14,7 +14,7 @@ export default Service.extend({
}, },
getIndexFor(url) { getIndexFor(url) {
return list[url] || 0; return list[url] || 1;
}, },
setIndexFor(url, value) { setIndexFor(url, value) {

View File

@ -26,7 +26,7 @@ export default function() {
const response = fn.apply(this, arguments); const response = fn.apply(this, arguments);
// Get and increment the appropriate index // Get and increment the appropriate index
nomadIndices[url] || (nomadIndices[url] = 1); nomadIndices[url] || (nomadIndices[url] = 2);
const index = nomadIndices[url]; const index = nomadIndices[url];
nomadIndices[url]++; nomadIndices[url]++;

View File

@ -103,7 +103,7 @@ test('findAll can be watched', function(assert) {
); );
assert.equal( assert.equal(
pretender.handledRequests[1].url, pretender.handledRequests[1].url,
'/v1/jobs?index=0', '/v1/jobs?index=1',
'Second request is a blocking request for jobs' 'Second request is a blocking request for jobs'
); );
@ -111,7 +111,7 @@ test('findAll can be watched', function(assert) {
request(); request();
assert.equal( assert.equal(
pretender.handledRequests[2].url, pretender.handledRequests[2].url,
'/v1/jobs?index=1', '/v1/jobs?index=2',
'Third request is a blocking request with an incremented index param' 'Third request is a blocking request with an incremented index param'
); );
@ -137,7 +137,7 @@ test('findRecord can be watched', function(assert) {
); );
assert.equal( assert.equal(
pretender.handledRequests[1].url, pretender.handledRequests[1].url,
'/v1/job/job-1?index=0', '/v1/job/job-1?index=1',
'Second request is a blocking request for job-1' 'Second request is a blocking request for job-1'
); );
@ -145,7 +145,7 @@ test('findRecord can be watched', function(assert) {
request(); request();
assert.equal( assert.equal(
pretender.handledRequests[2].url, pretender.handledRequests[2].url,
'/v1/job/job-1?index=1', '/v1/job/job-1?index=2',
'Third request is a blocking request with an incremented index param' 'Third request is a blocking request with an incremented index param'
); );
@ -174,7 +174,7 @@ test('relationship reloads can be watched', function(assert) {
this.subject().reloadRelationship(mockModel, 'summary', true); this.subject().reloadRelationship(mockModel, 'summary', true);
assert.equal( assert.equal(
pretender.handledRequests[0].url, pretender.handledRequests[0].url,
'/v1/job/job-1/summary?index=0', '/v1/job/job-1/summary?index=1',
'First request is a blocking request for job-1 summary relationship' 'First request is a blocking request for job-1 summary relationship'
); );
@ -182,7 +182,7 @@ test('relationship reloads can be watched', function(assert) {
this.subject().reloadRelationship(mockModel, 'summary', true); this.subject().reloadRelationship(mockModel, 'summary', true);
assert.equal( assert.equal(
pretender.handledRequests[1].url, pretender.handledRequests[1].url,
'/v1/job/job-1/summary?index=1', '/v1/job/job-1/summary?index=2',
'Second request is a blocking request with an incremented index param' 'Second request is a blocking request with an incremented index param'
); );
}); });