Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
react-native-notifications
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
冷佳娟
react-native-notifications
Commits
6fa36f2b
Commit
6fa36f2b
authored
Apr 11, 2016
by
Lidan Hifi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed es6 syntax in spec file
parent
f07e731f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
test/index.ios.spec.js
test/index.ios.spec.js
+9
-9
No files found.
test/index.ios.spec.js
View file @
6fa36f2b
...
@@ -2,7 +2,7 @@ let expect = require("chai").use(require("sinon-chai")).expect;
...
@@ -2,7 +2,7 @@ let expect = require("chai").use(require("sinon-chai")).expect;
let
proxyquire
=
require
(
"
proxyquire
"
);
let
proxyquire
=
require
(
"
proxyquire
"
);
let
sinon
=
require
(
"
sinon
"
);
let
sinon
=
require
(
"
sinon
"
);
describe
(
"
NotificationsIOS
"
,
function
()
{
describe
(
"
NotificationsIOS
"
,
()
=>
{
let
deviceEvents
=
[
let
deviceEvents
=
[
"
notificationReceivedForeground
"
,
"
notificationReceivedForeground
"
,
"
notificationReceivedBackground
"
,
"
notificationReceivedBackground
"
,
...
@@ -44,25 +44,25 @@ describe("NotificationsIOS", function () {
...
@@ -44,25 +44,25 @@ describe("NotificationsIOS", function () {
notificationIOS
=
null
;
notificationIOS
=
null
;
});
});
describe
(
"
Add Event Listener
"
,
function
()
{
describe
(
"
Add Event Listener
"
,
()
=>
{
deviceEvents
.
forEach
(
function
(
event
)
{
deviceEvents
.
forEach
(
event
=>
{
it
(
`should subscribe the given handler to device event:
${
event
}
`
,
function
()
{
it
(
`should subscribe the given handler to device event:
${
event
}
`
,
()
=>
{
notificationIOS
.
addEventListener
(
event
,
someHandler
);
notificationIOS
.
addEventListener
(
event
,
someHandler
);
expect
(
addEventListenerSpy
).
to
.
have
.
been
.
calledWith
(
event
,
sinon
.
match
.
func
);
expect
(
addEventListenerSpy
).
to
.
have
.
been
.
calledWith
(
event
,
sinon
.
match
.
func
);
});
});
});
});
it
(
"
should not subscribe to unknown device events
"
,
function
()
{
it
(
"
should not subscribe to unknown device events
"
,
()
=>
{
notificationIOS
.
addEventListener
(
"
someUnsupportedEvent
"
,
someHandler
);
notificationIOS
.
addEventListener
(
"
someUnsupportedEvent
"
,
someHandler
);
expect
(
addEventListenerSpy
).
to
.
not
.
have
.
been
.
called
;
expect
(
addEventListenerSpy
).
to
.
not
.
have
.
been
.
called
;
});
});
});
});
describe
(
"
Remove Event Listener
"
,
function
()
{
describe
(
"
Remove Event Listener
"
,
()
=>
{
deviceEvents
.
forEach
(
function
(
event
)
{
deviceEvents
.
forEach
(
event
=>
{
it
(
`should unsubscribe the given handler from device event:
${
event
}
`
,
function
()
{
it
(
`should unsubscribe the given handler from device event:
${
event
}
`
,
()
=>
{
notificationIOS
.
addEventListener
(
event
,
someHandler
);
notificationIOS
.
addEventListener
(
event
,
someHandler
);
notificationIOS
.
removeEventListener
(
event
,
someHandler
);
notificationIOS
.
removeEventListener
(
event
,
someHandler
);
...
@@ -70,7 +70,7 @@ describe("NotificationsIOS", function () {
...
@@ -70,7 +70,7 @@ describe("NotificationsIOS", function () {
});
});
});
});
it
(
"
should not unsubscribe to unknown device events
"
,
function
()
{
it
(
"
should not unsubscribe to unknown device events
"
,
()
=>
{
let
someUnsupportedEvent
=
"
someUnsupportedEvent
"
;
let
someUnsupportedEvent
=
"
someUnsupportedEvent
"
;
notificationIOS
.
addEventListener
(
someUnsupportedEvent
,
someHandler
);
notificationIOS
.
addEventListener
(
someUnsupportedEvent
,
someHandler
);
notificationIOS
.
removeEventListener
(
someUnsupportedEvent
,
someHandler
);
notificationIOS
.
removeEventListener
(
someUnsupportedEvent
,
someHandler
);
...
...
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