mirror of
https://github.com/darkwire/darkwire.io.git
synced 2025-07-19 02:59:57 +00:00
Started write of tests
This commit is contained in:
parent
7816f2aa87
commit
0a29d92aed
@ -4,4 +4,4 @@ node_js:
|
||||
before_script:
|
||||
- gulp bundle
|
||||
- sleep 5
|
||||
script: gulp test
|
||||
script: npm test
|
||||
|
@ -24,11 +24,6 @@ export default class Darkwire {
|
||||
return file.data;
|
||||
}
|
||||
|
||||
set fileQueue(fileQueue) {
|
||||
this._fileQueue = fileQueue;
|
||||
return this;
|
||||
}
|
||||
|
||||
get autoEmbedImages() {
|
||||
return this._autoEmbedImages;
|
||||
}
|
||||
|
10
src/room.js
10
src/room.js
@ -27,7 +27,7 @@ class Room {
|
||||
vector: data.vector,
|
||||
secretKeys: data.secretKeys,
|
||||
signature: data.signature,
|
||||
timestamp: new Date
|
||||
timestamp: new Date()
|
||||
});
|
||||
});
|
||||
|
||||
@ -48,7 +48,7 @@ class Room {
|
||||
username: socket.username,
|
||||
numUsers: this.numUsers,
|
||||
users: this.users,
|
||||
timestamp: new Date
|
||||
timestamp: new Date()
|
||||
});
|
||||
});
|
||||
|
||||
@ -78,7 +78,7 @@ class Room {
|
||||
numUsers: this.numUsers,
|
||||
users: this.users,
|
||||
id: socket.user.id,
|
||||
timestamp: new Date
|
||||
timestamp: new Date()
|
||||
});
|
||||
|
||||
// remove room from rooms array
|
||||
@ -111,7 +111,7 @@ class Room {
|
||||
newUsername: data.newUsername,
|
||||
publicKey: data.publicKey,
|
||||
users: this.users,
|
||||
timestamp: new Date
|
||||
timestamp: new Date()
|
||||
});
|
||||
|
||||
});
|
||||
@ -119,7 +119,7 @@ class Room {
|
||||
});
|
||||
}
|
||||
|
||||
get roomId() {
|
||||
roomId() {
|
||||
return this.id;
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,7 @@
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title">About</h4>
|
||||
<p><strong>Darkwire Version:</strong> v{{APP.version}} (<a href="https://github.com/seripap/darkwire.io/releases/tag/v{{APP.version}}" target="_blank">View Release Notes</a>)<br></p>
|
||||
<p><strong>Darkwire Version:</strong> <span id="appVersion">v{{APP.version}}</span> (<a href="https://github.com/seripap/darkwire.io/releases/tag/v{{APP.version}}" target="_blank">View Release Notes</a>)<br></p>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{>partials/disclaimer}}
|
||||
|
31
test/app.js
31
test/app.js
@ -1,15 +1,18 @@
|
||||
import appPkg from '../package.json';
|
||||
import helpers from './helpers';
|
||||
import app from '../index';
|
||||
import mochaJSCS from 'mocha-jscs';
|
||||
import mochaJSHint from 'mocha-jshint';
|
||||
import Browser from 'zombie';
|
||||
|
||||
const APPVER = 'v' + appPkg.version;
|
||||
|
||||
const Browser = require('zombie');
|
||||
Browser.localhost('localhost', 3000);
|
||||
|
||||
mochaJSCS();
|
||||
mochaJSHint();
|
||||
|
||||
describe('Visiting /', () => {
|
||||
describe('Darkwire', () => {
|
||||
|
||||
const browser = new Browser();
|
||||
|
||||
@ -22,19 +25,25 @@ describe('Visiting /', () => {
|
||||
browser.visit('/', done);
|
||||
});
|
||||
|
||||
it('should be successful', () => {
|
||||
browser.assert.success();
|
||||
});
|
||||
describe('Navigate to /', () => {
|
||||
it('should be running released version', () => {
|
||||
browser.assert.text('#appVersion', APPVER);
|
||||
});
|
||||
|
||||
it('should show welcome modal', () => {
|
||||
browser.assert.evaluate('$("#first-modal:visible").length', 1);
|
||||
browser.assert.text('#first-modal h4.modal-title', 'Welcome to darkwire.io');
|
||||
it('should be successful', () => {
|
||||
browser.assert.success();
|
||||
});
|
||||
|
||||
it('should show welcome modal', () => {
|
||||
browser.assert.evaluate('$("#first-modal:visible").length', 1);
|
||||
browser.assert.text('#first-modal h4.modal-title', 'Welcome to darkwire.io ' + APPVER);
|
||||
});
|
||||
});
|
||||
|
||||
describe('closing the initial modal', () => {
|
||||
|
||||
before((done) => {
|
||||
browser.pressButton('#first-modal .modal-footer button', done);
|
||||
return browser.pressButton('#first-modal .modal-footer button', done);
|
||||
});
|
||||
|
||||
it('should close the modal and show the main chat page', () => {
|
||||
@ -68,7 +77,9 @@ describe('Visiting /', () => {
|
||||
|
||||
it('should send message', () => {
|
||||
browser.tabs.current = 0;
|
||||
browser.assert.text('body', /Hello world/);
|
||||
browser.wait('1s', () => {
|
||||
browser.assert.text('.messageBody', /Hello world/);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user