Updated unit test so it will work with localization

Localization files are not loaded in unit tests. The variable names are
returned by localization when language files are not loaded.
This commit is contained in:
Loek Janssen 2015-11-11 13:30:13 +01:00
parent 0c63e38ab7
commit 76ce2a1380
1 changed files with 4 additions and 4 deletions

View File

@ -107,10 +107,10 @@ describe('Remote Frame Buffer Protocol Client', function() {
beforeEach(function () { this.clock = sinon.useFakeTimers(); }); beforeEach(function () { this.clock = sinon.useFakeTimers(); });
afterEach(function () { this.clock.restore(); }); afterEach(function () { this.clock.restore(); });
it('should set the state to "Authentication"', function () { it('should set the state to "{authentication}"', function () {
client._rfb_state = "blah"; client._rfb_state = "blah";
client.sendPassword('pass'); client.sendPassword('pass');
expect(client._rfb_state).to.equal('Authentication'); expect(client._rfb_state).to.equal('{authentication}');
}); });
it('should call init_msg "soon"', function () { it('should call init_msg "soon"', function () {
@ -637,7 +637,7 @@ describe('Remote Frame Buffer Protocol Client', function() {
client._sock._websocket._receive_data(failure_data); client._sock._websocket._receive_data(failure_data);
expect(client._fail).to.have.been.calledTwice; expect(client._fail).to.have.been.calledTwice;
expect(client._fail).to.have.been.calledWith('Security failure: whoops'); expect(client._fail).to.have.been.calledWith('{errorSecurity}');
}); });
it('should transition to the Authentication state and continue on successful negotiation', function () { it('should transition to the Authentication state and continue on successful negotiation', function () {
@ -677,7 +677,7 @@ describe('Remote Frame Buffer Protocol Client', function() {
sinon.spy(client, '_fail'); sinon.spy(client, '_fail');
client._sock._websocket._receive_data(new Uint8Array(data)); client._sock._websocket._receive_data(new Uint8Array(data));
expect(client._rfb_state).to.equal('failed'); expect(client._rfb_state).to.equal('failed');
expect(client._fail).to.have.been.calledWith('Auth failure: Whoopsies'); expect(client._fail).to.have.been.calledWith('{errorAuthFailure}');
}); });
it('should transition straight to SecurityResult on "no auth" (1) for versions >= 3.8', function () { it('should transition straight to SecurityResult on "no auth" (1) for versions >= 3.8', function () {