From 23dfa8924d86704edf22d5ff7a0872606f3566b7 Mon Sep 17 00:00:00 2001 From: Tom Chen Date: Mon, 6 Mar 2017 17:52:33 -0800 Subject: [PATCH 1/6] EPICENTER-2568: add test for run api variable with & --- tests/spec/test-run-api-service.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/spec/test-run-api-service.js b/tests/spec/test-run-api-service.js index d2fe1366..f1029f37 100644 --- a/tests/spec/test-run-api-service.js +++ b/tests/spec/test-run-api-service.js @@ -535,7 +535,16 @@ var req = server.requests.pop(); req.url.should.equal(baseURL + ';saved=true/'); req.requestBody.should.equal(JSON.stringify(params)); + }); + it('should save variables with &', function () { + var params = { '&test&': true, '&test2&': '&' }; + var rs = new RunService({ account: account, project: 'js-libs', filter: { saved: true } }); + rs.save(params); + var req = server.requests.pop(); + + req.url.should.equal(baseURL + ';saved=true/'); + req.requestBody.should.equal(JSON.stringify(params)); }); }); //variables From c679b56a7b897d0b6ac93aa8efbf83daa3e6a744 Mon Sep 17 00:00:00 2001 From: Tom Chen Date: Tue, 7 Mar 2017 13:18:28 -0800 Subject: [PATCH 2/6] EPICENTER-2568: add test for & in GET --- tests/spec/test-run-api-service.js | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/tests/spec/test-run-api-service.js b/tests/spec/test-run-api-service.js index f1029f37..dfd92f82 100644 --- a/tests/spec/test-run-api-service.js +++ b/tests/spec/test-run-api-service.js @@ -406,6 +406,27 @@ fail.should.not.have.been.called; }); }); + + it('should call GET with & in variable name', function () { + var rs = new RunService({ account: account, project: project }); + rs.query({ '&saved': true, '.price&': '1' }); + var req = server.requests.pop(); + req.url.should.equal(baseURL + ';&saved=true;.price&=1/'); + }); + + it('should call GET with & in long variable names', function () { + var rs = new RunService({ account: account, project: project }); + var variableObj = {}; + var variableArray = []; + for (var i = 0; i < 150; i++) { + var name = '&variable' + i; + variableObj[name] = true; + variableArray.push(name + '=true'); + } + rs.query(variableObj); + var req = server.requests.pop(); + req.url.should.equal(baseURL + ';' + variableArray.join(';') + '/'); + }); }); describe('#filter', function () { @@ -503,6 +524,31 @@ req.url.should.equal(baseURL + 'myfancyrunid/'); req.requestHeaders['X-AutoRestore'].should.equal(true); }); + it('should do an GET with & in variable name', function () { + var rs = new RunService({ account: account, project: project }); + rs.load('myfancyrunid', { include: 'score&' }); + + var req = server.requests.pop(); + req.url.should.equal(baseURL + 'myfancyrunid/?include=score&'); + + }); + it('should do an GET with & in variable names', function () { + var rs = new RunService({ account: account, project: project }); + rs.load('myfancyrunid', { include: ['score&', '&score2'] }); + var req = server.requests.pop(); + req.url.should.equal(baseURL + 'myfancyrunid/?include=score&,&score2'); + }); + + it('should do an GET with & in long variable names', function () { + var rs = new RunService({ account: account, project: project }); + var include = []; + for (var i = 0; i < 300; i++) { + include.push('score' + i + '&'); + } + rs.load('myfancyrunid', { include: include }); + var req = server.requests.pop(); + req.url.should.equal(baseURL + 'myfancyrunid/?include=' + include.join(',')); + }); }); describe('#save()', function () { From e317fbdd6e1d7f625eec48939495b57293bef398 Mon Sep 17 00:00:00 2001 From: Tom Chen Date: Tue, 7 Mar 2017 15:22:52 -0800 Subject: [PATCH 3/6] EPICENTER-2568: change & test --- tests/spec/test-run-api-service.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/spec/test-run-api-service.js b/tests/spec/test-run-api-service.js index dfd92f82..21142f43 100644 --- a/tests/spec/test-run-api-service.js +++ b/tests/spec/test-run-api-service.js @@ -416,16 +416,18 @@ it('should call GET with & in long variable names', function () { var rs = new RunService({ account: account, project: project }); - var variableObj = {}; var variableArray = []; - for (var i = 0; i < 150; i++) { - var name = '&variable' + i; - variableObj[name] = true; - variableArray.push(name + '=true'); + for (var i = 0; i < 500; i++) { + var name = '&variable'; + variableArray.push(name); } - rs.query(variableObj); - var req = server.requests.pop(); - req.url.should.equal(baseURL + ';' + variableArray.join(';') + '/'); + rs.query({}, { include: variableArray }); + server.respond(); + server.requests.length.should.be.above(1); + server.requests.forEach(function (xhr) { + xhr.url.length.should.be.below(2049); + }); + }); }); From fcca27f3fdcc30913fc63d07d07703c25aa1b5f0 Mon Sep 17 00:00:00 2001 From: Tom Chen Date: Thu, 9 Mar 2017 11:26:23 -0800 Subject: [PATCH 4/6] EPICENTER-2568: move tests to variable api --- tests/spec/test-run-api-service.js | 57 ------------------------ tests/spec/test-variables-api-service.js | 21 +++++++++ 2 files changed, 21 insertions(+), 57 deletions(-) diff --git a/tests/spec/test-run-api-service.js b/tests/spec/test-run-api-service.js index 21142f43..d2fe1366 100644 --- a/tests/spec/test-run-api-service.js +++ b/tests/spec/test-run-api-service.js @@ -406,29 +406,6 @@ fail.should.not.have.been.called; }); }); - - it('should call GET with & in variable name', function () { - var rs = new RunService({ account: account, project: project }); - rs.query({ '&saved': true, '.price&': '1' }); - var req = server.requests.pop(); - req.url.should.equal(baseURL + ';&saved=true;.price&=1/'); - }); - - it('should call GET with & in long variable names', function () { - var rs = new RunService({ account: account, project: project }); - var variableArray = []; - for (var i = 0; i < 500; i++) { - var name = '&variable'; - variableArray.push(name); - } - rs.query({}, { include: variableArray }); - server.respond(); - server.requests.length.should.be.above(1); - server.requests.forEach(function (xhr) { - xhr.url.length.should.be.below(2049); - }); - - }); }); describe('#filter', function () { @@ -526,31 +503,6 @@ req.url.should.equal(baseURL + 'myfancyrunid/'); req.requestHeaders['X-AutoRestore'].should.equal(true); }); - it('should do an GET with & in variable name', function () { - var rs = new RunService({ account: account, project: project }); - rs.load('myfancyrunid', { include: 'score&' }); - - var req = server.requests.pop(); - req.url.should.equal(baseURL + 'myfancyrunid/?include=score&'); - - }); - it('should do an GET with & in variable names', function () { - var rs = new RunService({ account: account, project: project }); - rs.load('myfancyrunid', { include: ['score&', '&score2'] }); - var req = server.requests.pop(); - req.url.should.equal(baseURL + 'myfancyrunid/?include=score&,&score2'); - }); - - it('should do an GET with & in long variable names', function () { - var rs = new RunService({ account: account, project: project }); - var include = []; - for (var i = 0; i < 300; i++) { - include.push('score' + i + '&'); - } - rs.load('myfancyrunid', { include: include }); - var req = server.requests.pop(); - req.url.should.equal(baseURL + 'myfancyrunid/?include=' + include.join(',')); - }); }); describe('#save()', function () { @@ -583,16 +535,7 @@ var req = server.requests.pop(); req.url.should.equal(baseURL + ';saved=true/'); req.requestBody.should.equal(JSON.stringify(params)); - }); - - it('should save variables with &', function () { - var params = { '&test&': true, '&test2&': '&' }; - var rs = new RunService({ account: account, project: 'js-libs', filter: { saved: true } }); - rs.save(params); - var req = server.requests.pop(); - req.url.should.equal(baseURL + ';saved=true/'); - req.requestBody.should.equal(JSON.stringify(params)); }); }); //variables diff --git a/tests/spec/test-variables-api-service.js b/tests/spec/test-variables-api-service.js index 46948d11..f5bd1a63 100644 --- a/tests/spec/test-variables-api-service.js +++ b/tests/spec/test-variables-api-service.js @@ -200,6 +200,27 @@ var req = server.requests.pop(); req.requestHeaders.should.not.have.property('X-AutoRestore'); }); + + it('should call GET with & in variable name', function () { + vs.query(['&saved', '.price&']); + var req = server.requests.pop(); + req.url.should.equal(baseURL + ';/variables/?include=&saved,.price&'); + }); + + it('should call GET with & in long variable names', function () { + var variableArray = []; + for (var i = 0; i < 500; i++) { + var name = '&variable'; + variableArray.push(name); + } + vs.query(variableArray); + server.respond(); + server.requests.length.should.be.above(1); + server.requests.forEach(function (xhr) { + xhr.url.length.should.be.below(2049); + }); + + }); }); From fce0bd2bd72eb0832d8b30325733f8df988fe5c9 Mon Sep 17 00:00:00 2001 From: Molly Jones Date: Mon, 13 Mar 2017 14:21:35 -0700 Subject: [PATCH 5/6] update changelog with release date, and to reflect latest feedback on presence service docs --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0143ed87..7dc3e7b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ -### 2.2.0 (2017-03-01) +### 2.2.0 (2017-03-15) This is one of our biggest releases of Epicenter.js in a while. It includes: @@ -172,7 +172,7 @@ The `savedRuns` manager gives you utility functions for dealing with multiple ru ### Presence Service -The Presence API Service provides methods to get and set the presence of an end user in a project, that is, to indicate whether the end user is online. This can be done explicitly: you can make a call, using this service, to indicate that a particular end user is online or offline. This is also done automatically: in projects that use channels, the end user's presence is published automatically on a "presence" channel that is specific to each group. See [complete details on the Presence Service](http://forio.com/epicenter/docs/public/api_adapters/generated/presence-api-service/) and also the updated [Epicenter Channel Manager's getPresenceChannel()](http://forio.com/epicenter/docs/public/api_adapters/generated/epicenter-channel-manager/#getpresencechannel). +The Presence API Service provides methods to get and set the presence of an end user in a project, that is, to indicate whether the end user is online. This happens automatically: in projects that use channels, the end user's presence is published automatically on a "presence" channel that is specific to each group. You can also use the Presence API Service to do this explicitly: you can make a call to indicate that a particular end user is online or offline. See [complete details on the Presence Service](http://forio.com/epicenter/docs/public/api_adapters/generated/presence-api-service/) and also the updated [Epicenter Channel Manager's getPresenceChannel()](http://forio.com/epicenter/docs/public/api_adapters/generated/epicenter-channel-manager/#getpresencechannel). ### jQuery Version Requirements From 0b19a002b416ef851b2567db6c5bd2de0af0e9af Mon Sep 17 00:00:00 2001 From: Molly Jones Date: Mon, 13 Mar 2017 14:35:58 -0700 Subject: [PATCH 6/6] Release v2.2.0 (pre-release) --- dist/components/assignment/index.html | 6 +++--- dist/components/login/index.html | 6 +++--- dist/epicenter.js | 4 ++-- dist/epicenter.min.js | 2 +- package.json | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/dist/components/assignment/index.html b/dist/components/assignment/index.html index cbab2e5b..0a32e9ee 100644 --- a/dist/components/assignment/index.html +++ b/dist/components/assignment/index.html @@ -7,7 +7,7 @@ - + @@ -73,8 +73,8 @@ - - + + - - + +