mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Appease validation warning about "Unsafe assignment to innerHTML"
This doesn't apply to the webextension but hasn't been factored out in the build step yet.
This commit is contained in:
parent
ff6f91f3da
commit
055d5f1824
2 changed files with 8 additions and 2 deletions
|
@ -4,6 +4,7 @@ jasmine tests for Snowflake UI
|
|||
|
||||
document =
|
||||
getElementById: (id) -> {}
|
||||
createTextNode: (txt) -> txt
|
||||
|
||||
describe 'UI', ->
|
||||
|
||||
|
@ -27,7 +28,9 @@ describe 'UI', ->
|
|||
|
||||
it 'sets status message when in debug mode', ->
|
||||
u = new DebugUI()
|
||||
u.$status = { innerHTML: '' }
|
||||
u.$status =
|
||||
innerHTML: ''
|
||||
appendChild: (txt) -> @innerHTML = txt
|
||||
u.setStatus('test')
|
||||
expect(u.$status.innerHTML).toEqual 'Status: test'
|
||||
|
||||
|
|
|
@ -37,7 +37,10 @@ class DebugUI extends UI
|
|||
|
||||
# Status bar
|
||||
setStatus: (msg) ->
|
||||
@$status.innerHTML = 'Status: ' + msg
|
||||
txt = document.createTextNode('Status: ' + msg)
|
||||
while @$status.firstChild
|
||||
@$status.removeChild @$status.firstChild
|
||||
@$status.appendChild txt
|
||||
|
||||
setActive: (connected) ->
|
||||
super connected
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue