mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
FIX: smoke test :fired:
This commit is contained in:
parent
5a14dcc991
commit
6d4c07385f
4 changed files with 21 additions and 34 deletions
|
@ -31,6 +31,6 @@ export default Ember.Component.extend({
|
||||||
return categoryBadgeHTML(category, {allowUncategorized: true});
|
return categoryBadgeHTML(category, {allowUncategorized: true});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}.on('didInsertElement'),
|
}.on('didInsertElement')
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,25 +1,14 @@
|
||||||
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
import ModalFunctionality from 'discourse/mixins/modal-functionality';
|
||||||
import { setting } from 'discourse/lib/computed';
|
|
||||||
|
|
||||||
export default Ember.Controller.extend(ModalFunctionality, {
|
export default Ember.Controller.extend(ModalFunctionality, {
|
||||||
remote: Em.computed.not("local"),
|
|
||||||
local: false,
|
|
||||||
showMore: false,
|
showMore: false,
|
||||||
|
local: true,
|
||||||
_initialize: function() {
|
remote: Ember.computed.not("local"),
|
||||||
this.setProperties({
|
|
||||||
local: this.get("allowLocal"),
|
|
||||||
showMore: false
|
|
||||||
});
|
|
||||||
}.on('init'),
|
|
||||||
|
|
||||||
maxSize: setting('max_attachment_size_kb'),
|
|
||||||
allowLocal: Em.computed.gt('maxSize', 0),
|
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
useLocal: function() { this.setProperties({ local: true, showMore: false}); },
|
useLocal() { this.setProperties({ local: true, showMore: false}); },
|
||||||
useRemote: function() { this.set("local", false); },
|
useRemote() { this.set("local", false); },
|
||||||
toggleShowMore: function() { this.toggleProperty("showMore"); }
|
toggleShowMore() { this.toggleProperty("showMore"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,16 +1,14 @@
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
{{#if allowLocal}}
|
<div class="radios">
|
||||||
<div class="radios">
|
<input type="radio" id="local" value="local" name="upload" {{action "useLocal"}}>
|
||||||
<input type="radio" id="local" value="local" name="upload" {{action "useLocal"}}>
|
<label class="radio" for="local">{{i18n 'upload_selector.from_my_computer'}}</label>
|
||||||
<label class="radio" for="local">{{i18n 'upload_selector.from_my_computer'}}</label>
|
{{#if local}}
|
||||||
{{#if local}}
|
<div class="inputs">
|
||||||
<div class="inputs">
|
<input type="file" id="filename-input" multiple><br>
|
||||||
<input type="file" id="filename-input" multiple><br>
|
<span class="description">{{unbound view.tip}}</span>
|
||||||
<span class="description">{{unbound view.tip}}</span>
|
</div>
|
||||||
</div>
|
{{/if}}
|
||||||
{{/if}}
|
</div>
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
<div class="radios">
|
<div class="radios">
|
||||||
<input type="radio" id="remote" value="remote" name="upload" {{action "useRemote"}}>
|
<input type="radio" id="remote" value="remote" name="upload" {{action "useRemote"}}>
|
||||||
<label class="radio" for="remote">{{i18n 'upload_selector.from_the_web'}}</label>
|
<label class="radio" for="remote">{{i18n 'upload_selector.from_the_web'}}</label>
|
||||||
|
|
|
@ -66,9 +66,9 @@ var upload = function(input, path) {
|
||||||
actions.push({ upload: path, input: input });
|
actions.push({ upload: path, input: input });
|
||||||
}
|
}
|
||||||
|
|
||||||
var screenshot = function(filename) {
|
// var screenshot = function(filename) {
|
||||||
actions.push({ screenshot: filename });
|
// actions.push({ screenshot: filename });
|
||||||
}
|
// }
|
||||||
|
|
||||||
var run = function() {
|
var run = function() {
|
||||||
var allPassed = true;
|
var allPassed = true;
|
||||||
|
@ -86,7 +86,7 @@ var run = function() {
|
||||||
actions = actions.splice(1);
|
actions = actions.splice(1);
|
||||||
if (action.test) {
|
if (action.test) {
|
||||||
page.waitFor(action.desc, action.test, function(success) {
|
page.waitFor(action.desc, action.test, function(success) {
|
||||||
allPassed &= success;
|
allPassed = allPassed && success;
|
||||||
performNextAction();
|
performNextAction();
|
||||||
});
|
});
|
||||||
} else if (action.exec) {
|
} else if (action.exec) {
|
||||||
|
@ -230,7 +230,7 @@ var runTests = function() {
|
||||||
run();
|
run();
|
||||||
};
|
};
|
||||||
|
|
||||||
page.open(system.args[1], function(status) {
|
page.open(system.args[1], function() {
|
||||||
console.log("OPENED: " + system.args[1]);
|
console.log("OPENED: " + system.args[1]);
|
||||||
runTests();
|
runTests();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue