mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 14:11:23 -04:00
Compile coffee files and remove them
With, ./node_modules/.bin/coffee -b -c Cakefile `find . -path ./node_modules -prune -o -name '*.coffee'`
This commit is contained in:
parent
82562fb21d
commit
31ad9566e6
38 changed files with 2277 additions and 1725 deletions
34
proxy/spec/init.spec.js
Normal file
34
proxy/spec/init.spec.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
// Generated by CoffeeScript 2.4.1
|
||||
// Fake snowflake to interact with
|
||||
var snowflake;
|
||||
|
||||
snowflake = {
|
||||
ui: new UI,
|
||||
broker: {
|
||||
sendAnswer: function() {}
|
||||
},
|
||||
state: Snowflake.MODE.INIT
|
||||
};
|
||||
|
||||
describe('Init', function() {
|
||||
it('gives a dialog when closing, only while active', function() {
|
||||
var msg, silenceNotifications;
|
||||
silenceNotifications = false;
|
||||
snowflake.state = Snowflake.MODE.WEBRTC_READY;
|
||||
msg = window.onbeforeunload();
|
||||
expect(snowflake.state).toBe(Snowflake.MODE.WEBRTC_READY);
|
||||
expect(msg).toBe(Snowflake.MESSAGE.CONFIRMATION);
|
||||
snowflake.state = Snowflake.MODE.INIT;
|
||||
msg = window.onbeforeunload();
|
||||
expect(snowflake.state).toBe(Snowflake.MODE.INIT);
|
||||
return expect(msg).toBe(null);
|
||||
});
|
||||
return it('does not give a dialog when silent flag is on', function() {
|
||||
var msg, silenceNotifications;
|
||||
silenceNotifications = true;
|
||||
snowflake.state = Snowflake.MODE.WEBRTC_READY;
|
||||
msg = window.onbeforeunload();
|
||||
expect(snowflake.state).toBe(Snowflake.MODE.WEBRTC_READY);
|
||||
return expect(msg).toBe(null);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue