Merge pull request #1897 from kchadha/fix-cloud-var-limit

Fix cloud variable limit
This commit is contained in:
Paul Kaplan 2019-01-07 13:28:47 -05:00 committed by GitHub
commit 94240d743e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 11 deletions

View file

@ -99,7 +99,7 @@ const ArgumentTypeMap = (() => {
* cloud variable.
*/
const cloudDataManager = () => {
const limit = 8;
const limit = 10;
let count = 0;
const canAddCloudVariable = () => count < limit;

Binary file not shown.

Binary file not shown.

View file

@ -56,9 +56,9 @@ test('importing an sb2 project with cloud variables at the limit for a project',
const stage = vm.runtime.targets[0];
const stageVars = Object.values(stage.variables);
t.equal(stageVars.length, 8);
t.equal(stageVars.length, 10);
// All of the 8 stage variables should be cloud variables
t.equal(stageVars.filter(v => v.isCloud).length, 8);
t.equal(stageVars.filter(v => v.isCloud).length, 10);
t.end();
});
@ -83,7 +83,7 @@ test('importing an sb2 project with cloud variables exceeding the limit for a pr
t.equal(stageVars.length, 15);
// Only 8 of the variables should have the isCloud flag set to true
t.equal(stageVars.filter(v => v.isCloud).length, 8);
t.equal(stageVars.filter(v => v.isCloud).length, 10);
t.end();
});

View file

@ -54,9 +54,9 @@ test('importing an sb3 project with cloud variables at the limit for a project',
const stage = vm.runtime.targets[0];
const stageVars = Object.values(stage.variables);
t.equal(stageVars.length, 8);
// All of the 8 stage variables should be cloud variables
t.equal(stageVars.filter(v => v.isCloud).length, 8);
t.equal(stageVars.length, 10);
// All of the 10 stage variables should be cloud variables
t.equal(stageVars.filter(v => v.isCloud).length, 10);
t.end();
});
@ -81,7 +81,7 @@ test('importing an sb3 project with cloud variables exceeding the limit for a pr
t.equal(stageVars.length, 15);
// Only 8 of the variables should have the isCloud flag set to true
t.equal(stageVars.filter(v => v.isCloud).length, 8);
t.equal(stageVars.filter(v => v.isCloud).length, 10);
t.end();
});

View file

@ -139,7 +139,7 @@ test('Project loaded emits runtime event', t => {
});
});
test('Cloud variable limit allows only 8 cloud variables', t => {
test('Cloud variable limit allows only 10 cloud variables', t => {
// This is a test of just the cloud variable limit mechanism
// The functions being tested below need to be used when
// creating and deleting cloud variables in the runtime.
@ -148,7 +148,7 @@ test('Cloud variable limit allows only 8 cloud variables', t => {
t.equal(rt.hasCloudData(), false);
for (let i = 0; i < 8; i++) {
for (let i = 0; i < 10; i++) {
t.equal(rt.canAddCloudVariable(), true);
rt.addCloudVariable();
// Adding a cloud variable should change the
@ -172,7 +172,7 @@ test('Cloud variable limit allows only 8 cloud variables', t => {
rt.dispose();
t.equal(rt.hasCloudData(), false);
for (let i = 0; i < 8; i++) {
for (let i = 0; i < 10; i++) {
t.equal(rt.canAddCloudVariable(), true);
rt.addCloudVariable();
t.equal(rt.hasCloudData(), true);