Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
57 lines
1.3 KiB
JavaScript
Executable file
57 lines
1.3 KiB
JavaScript
Executable file
/* global DeviceInteraction, MockDriver, assert, exampleCmds, helper */
|
|
'use strict';
|
|
suite('marionette/multi-actions', function() {
|
|
var driver, subject, actions, client, device,
|
|
MultiActions, Actions, Client;
|
|
|
|
helper.require('multi-actions', function(obj) {
|
|
MultiActions = obj;
|
|
});
|
|
|
|
helper.require('actions', function(obj) {
|
|
Actions = obj;
|
|
});
|
|
|
|
helper.require('client', function(obj) {
|
|
Client = obj;
|
|
});
|
|
|
|
device = new DeviceInteraction(exampleCmds, function() {
|
|
return subject;
|
|
});
|
|
|
|
setup(function() {
|
|
driver = new MockDriver();
|
|
client = new Client(driver);
|
|
actions = new Actions(client);
|
|
subject = new MultiActions(client);
|
|
});
|
|
|
|
suite('initialization', function() {
|
|
test('should set client', function() {
|
|
assert.strictEqual(subject.client, client);
|
|
});
|
|
});
|
|
|
|
suite('.add', function() {
|
|
setup(function() {
|
|
subject.add(actions);
|
|
});
|
|
|
|
test('should have a action chain', function() {
|
|
assert.deepEqual(subject.multiActions[0], actions.actionChain);
|
|
});
|
|
});
|
|
|
|
suite('.perform', function() {
|
|
device.
|
|
issues('perform').
|
|
shouldSend({
|
|
type: 'multiAction',
|
|
value: [],
|
|
max_length: 0
|
|
}).
|
|
serverResponds('ok').
|
|
callbackReceives();
|
|
});
|
|
});
|