mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Make MODE a class constant
This commit is contained in:
parent
6b002c5f22
commit
9df66b15b1
4 changed files with 20 additions and 19 deletions
|
@ -25,7 +25,7 @@ snowflake =
|
|||
ui: fakeUI
|
||||
broker:
|
||||
sendAnswer: ->
|
||||
state: MODE.INIT
|
||||
state: Snowflake.MODE.INIT
|
||||
|
||||
describe 'Snowflake', ->
|
||||
|
||||
|
@ -72,19 +72,19 @@ describe 'Snowflake', ->
|
|||
|
||||
it 'gives a dialog when closing, only while active', ->
|
||||
silenceNotifications = false
|
||||
snowflake.state = MODE.WEBRTC_READY
|
||||
snowflake.state = Snowflake.MODE.WEBRTC_READY
|
||||
msg = window.onbeforeunload()
|
||||
expect(snowflake.state).toBe MODE.WEBRTC_READY
|
||||
expect(snowflake.state).toBe Snowflake.MODE.WEBRTC_READY
|
||||
expect(msg).toBe CONFIRMATION_MESSAGE
|
||||
|
||||
snowflake.state = MODE.INIT
|
||||
snowflake.state = Snowflake.MODE.INIT
|
||||
msg = window.onbeforeunload()
|
||||
expect(snowflake.state).toBe MODE.INIT
|
||||
expect(snowflake.state).toBe Snowflake.MODE.INIT
|
||||
expect(msg).toBe null
|
||||
|
||||
it 'does not give a dialog when silent flag is on', ->
|
||||
silenceNotifications = true
|
||||
snowflake.state = MODE.WEBRTC_READY
|
||||
snowflake.state = Snowflake.MODE.WEBRTC_READY
|
||||
msg = window.onbeforeunload()
|
||||
expect(snowflake.state).toBe MODE.WEBRTC_READY
|
||||
expect(snowflake.state).toBe Snowflake.MODE.WEBRTC_READY
|
||||
expect(msg).toBe null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue