Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
2f25ec88
Commit
2f25ec88
authored
Feb 02, 2015
by
Aron Carroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stub out the tests for the CrossFrameBridge component
parent
e3d4f8b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
cross-frame-bridge-test.coffee
tests/js/cross-frame-bridge-test.coffee
+53
-0
No files found.
tests/js/cross-frame-bridge-test.coffee
0 → 100644
View file @
2f25ec88
assert
=
chai
.
assert
sinon
.
assert
.
expose
assert
,
prefix
:
null
describe
'CrossFrameBridge'
,
->
sandbox
=
sinon
.
sandbox
.
create
()
createBridge
=
null
createChannel
=
null
beforeEach
module
(
'h'
)
beforeEach
module
(
CrossFrameBridge
)
->
createBridge
=
(
options
)
->
new
CrossFrameBridge
(
options
)
createChannel
->
call
:
sandbox
.
stub
()
bind
:
sandbox
.
stub
()
unbind
:
sandbox
.
stub
()
notify
:
sandbox
.
stub
()
afterEach
->
sandbox
.
restore
()
describe
'.createChannel'
,
->
it
'creates a new channel with the provided options'
it
'adds the channel to the .links property'
it
'registers any channelListeners on the channel'
it
'returns the newly created channel'
describe
'.call'
,
->
it
'forwards the call to every created channel'
it
'provides a timeout of 1000ms'
it
'calls options.callback when all channels return successfully'
it
'calls options.callback with an error when one or more channels fail'
it
'destroys the channel when a call fails'
it
'removes the channel from the .links array when a call fails'
it
'treats a timeout as a success with no result'
it
'returns a promise object'
describe
'.notify'
,
->
it
'publishes the message on every created channel'
describe
'.on'
,
->
it
'registers an event listener on all created channels'
it
'adds the message to the .channelListeners property'
it
'only allows one message to be registered per method'
describe
'.off'
,
->
it
'removes the event listener from the created channels'
it
'removes the method from th .channelListeners property'
describe
'.onConnect'
,
->
it
'adds a callback that is called when a new channel is connected'
it
'allows multiple callbacks to be registered'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment