Skip to content

Commit 7bf3c96

Browse files
committed
More fixes
1 parent f1864bb commit 7bf3c96

9 files changed

Lines changed: 94 additions & 131 deletions

File tree

app/components/file-editor-column.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@ export default Ember.Component.extend({
4343

4444
valueUpdated(value, __, changeObj) {
4545
const isUserChange = changeObj.origin !== 'setValue';
46-
this.attrs.contentChanged(isUserChange, value);
46+
this.get('contentChanged')(isUserChange, value);
4747
},
4848

4949
removeColumn(col) {
50-
this.attrs.removeColumn(col);
50+
this.get('removeColumn')(col);
5151
},
5252

5353
addColumn() {
54-
this.attrs.addColumn();
54+
this.get('addColumn')();
5555
},
5656

5757
showFileTree() {
58-
this.attrs.showFileTree();
58+
this.get('showFileTree')();
5959
}
6060
}
6161
});

app/mixins/app-builder.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export default Ember.Mixin.create({
1414
try {
1515
const buildOutput = yield this.get('emberCli').compileGist(this.get('model'));
1616
this.set('isBuilding', false);
17+
this.set('isOutputting', true);
1718
this.set('buildOutput', buildOutput);
1819
} catch(errors) {
1920
this.set('isBuilding', false);
@@ -26,7 +27,7 @@ export default Ember.Mixin.create({
2627
console.error(errors);
2728
}
2829
}
29-
}),
30+
}).enqueue(),
3031

3132
rebuildApp: task(function *() {
3233
if (this.get('isLiveReload')) {

app/templates/components/file-editor-column.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@
5252
fixedGutter=true
5353
lineWrapping=true
5454
tabSize=2)
55-
valueUpdated="valueUpdated"
55+
valueUpdated=(action "valueUpdated")
5656
}}
5757
{{/if}}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"ember-route-action-helper": "^1.0.0",
7575
"ember-source": "~2.11.0",
7676
"ember-test-helpers": "~0.6.3",
77-
"ivy-codemirror": "2.0.2",
77+
"ivy-codemirror": "~2.0.3",
7878
"loader.js": "~4.0.10",
7979
"moment": "~2.15.2",
8080
"moment-timezone": "~0.5.4",

tests/acceptance/gist-test.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ test('editing a file updates gist', function(assert) {
354354
return;
355355
}
356356

357+
click("#live-reload");
357358
click(firstColumnTextarea);
358359
fillIn(firstColumnTextarea, '<div class="index">some text</div>');
359360
triggerEvent(firstColumnTextarea, "blur");
@@ -362,7 +363,6 @@ test('editing a file updates gist', function(assert) {
362363
assert.equal(find(firstColumnTextarea).val(), '<div class="index">some text</div>');
363364
});
364365

365-
click("#live-reload");
366366
click(".run-now");
367367
waitForLoadedIFrame();
368368

@@ -391,15 +391,14 @@ test('own gist can be copied into a new one', function(assert) {
391391
});
392392

393393
fillIn('.title input', "my twiddle");
394+
keyEvent('.title input', 'keyup', 13);
394395
andThen(function() {
395396
assert.equal(find('.title input').val(), "my twiddle");
396397
});
397398

399+
click("#live-reload");
398400
click('.test-copy-action');
399-
400-
andThen(function() {
401-
waitForLoadedIFrame();
402-
});
401+
waitForLoadedIFrame();
403402

404403
andThen(function() {
405404
assert.equal(find('.title input').val(), "New Twiddle", "Description is reset");
@@ -427,11 +426,10 @@ test('accessing /:gist/copy creates a new Twiddle with a copy of the gist', func
427426
assert.equal(find('.test-unsaved-indicator').length, 1, "Changing title triggers unsaved indicator");
428427
});
429428

429+
click("#live-reload");
430430
visit('/35de43cb81fc35ddffb2/copy');
431-
432-
andThen(function() {
433-
waitForLoadedIFrame();
434-
});
431+
click('.run-now');
432+
waitForLoadedIFrame();
435433

436434
andThen(function() {
437435
assert.equal(currentURL(), '/');

tests/acceptance/git-revision-test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ test('Able to copy a revision into new gist', function(assert) {
5454
assert.equal(find('.title input').val(), "my twiddle");
5555
});
5656

57+
click("#live-reload");
5758
click('.test-copy-action');
5859

5960
andThen(function() {
@@ -88,6 +89,8 @@ test('Able to go from current version to revision and back via the UI', function
8889
assert.equal(outputContents('div'), 'Hello, World!');
8990
});
9091

92+
click("#live-reload");
93+
9194
createGist({
9295
files: [
9396
{
@@ -102,13 +105,15 @@ test('Able to go from current version to revision and back via the UI', function
102105
});
103106

104107
click(".test-version-action");
108+
click(".run-now");
105109
waitForLoadedIFrame();
106110

107111
andThen(() => {
108112
assert.equal(outputContents('div'), 'Hello, ...');
109113
});
110114

111115
click(".test-show-current-version");
116+
click(".run-now");
112117
waitForLoadedIFrame();
113118

114119
andThen(() => {

tests/acceptance/run-now-test.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ test('Able to reload the Twiddle', function(assert) {
1414

1515
runGist(files);
1616

17-
// turn off live reloading
18-
andThen(function() {
19-
find("#live-reload").click();
20-
});
17+
click("#live-reload");
2118

2219
andThen(function() {
2320
assert.equal(outputPane().find('input').val(), 'initial value');
@@ -27,13 +24,10 @@ test('Able to reload the Twiddle', function(assert) {
2724

2825
andThen(function() {
2926
assert.equal(outputPane().find('input').val(), 'new value');
30-
31-
find(".run-now").click();
3227
});
3328

34-
andThen(function() {
35-
waitForLoadedIFrame();
36-
});
29+
click(".run-now");
30+
waitForLoadedIFrame();
3731

3832
andThen(function() {
3933
assert.equal(outputPane().find('input').val(), 'initial value');

tests/helpers/wait-for-loaded-iframe.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default function(app, url) {
2222
return;
2323
}
2424
iframe_window = outputPane();
25-
if (iframe_window.loaded && iframe_window.document.readyState === 'complete') {
25+
if (iframe_window.document.readyState === 'complete') {
2626
onWindowLoad();
2727
} else {
2828
iframe_window.addEventListener('load', onWindowLoad);

0 commit comments

Comments
 (0)