gotty/js/spice-web-client/unittest/busprocess.test.js
Soren L. Hansen c66ae7b2e4 First, primitive stab at SPiCE integration
Launch an Xspice and run:
echo -ne "\033]844;127.0.0.1;9876\007"

This will launch a SPiCE client connecting to 127.0.0.1:9876.

Still need to add all the security stuff and generally be
more defensive in the implementation.
2021-04-16 06:50:05 -07:00

47 lines
1.4 KiB
JavaScript

suite("BusProcess:", function() {
var sut;
var clientGui, busConnection;
setup(function () {
clientGui = {};
busConnection = {};
sut = new wdi.BusProcess({ clientGui: clientGui, busConnection: busConnection });
});
suite('#parseMessage', function () {
test('Should fire "wrongPathError" when the type is "launchApplication" and the event is "applicationLauncherWrongAppPathError"', sinon.test(function () {
var body = {
type: wdi.BUS_TYPES.launchApplication,
event: "applicationLauncherWrongAppPathError"
};
this.mock(sut)
.expects('fire')
.once()
.withExactArgs('wrongPathError', body);
sut.parseMessage(body);
}));
test('Should not fire "wrongPathError" when the type is "launchApplication" and the event is not "applicationLauncherWrongAppPathError"', sinon.test(function () {
var body = {
type: wdi.BUS_TYPES.launchApplication,
event: "fakeEvent"
};
this.mock(sut)
.expects('fire')
.never();
sut.parseMessage(body);
}));
test('Should fire "applicationLaunchedSuccessfully" when the type is "launchApplication" and the event is "applicationLaunchedSuccessfully"', sinon.test(function () {
var body = {
type: wdi.BUS_TYPES.launchApplication,
event: "applicationLaunchedSuccessfully"
};
this.mock(sut)
.expects('fire')
.once()
.withExactArgs('applicationLaunchedSuccessfully', body);
sut.parseMessage(body);
}));
});
});