mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
confirmation dialog on proxy close (close #23)
This commit is contained in:
parent
8a8273e972
commit
d2e61e315c
2 changed files with 21 additions and 0 deletions
|
@ -23,6 +23,7 @@ snowflake =
|
|||
ui: fakeUI
|
||||
broker:
|
||||
sendAnswer: ->
|
||||
state: MODE.INIT
|
||||
|
||||
describe 'Snowflake', ->
|
||||
|
||||
|
@ -58,3 +59,14 @@ describe 'Snowflake', ->
|
|||
s = new Snowflake(new FakeBroker(), fakeUI)
|
||||
s.makeProxyPair()
|
||||
expect(s.proxyPairs.length).toBe 2
|
||||
|
||||
it 'gives a dialog when closing, only while active', ->
|
||||
snowflake.state = MODE.WEBRTC_READY
|
||||
msg = window.onbeforeunload()
|
||||
expect(snowflake.state).toBe MODE.WEBRTC_READY
|
||||
expect(msg).toBe CONFIRMATION_MESSAGE
|
||||
|
||||
snowflake.state = MODE.INIT
|
||||
msg = window.onbeforeunload()
|
||||
expect(snowflake.state).toBe MODE.INIT
|
||||
expect(msg).toBe null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue