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
98f3da28
Commit
98f3da28
authored
Jul 28, 2019
by
yogevbd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix android unit tests
parent
e6f3d7e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
android/app/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotificationProps.java
...otifications/core/notification/PushNotificationProps.java
+2
-2
android/app/src/test/java/com/wix/reactnativenotifications/core/notification/PushNotificationTest.java
...notifications/core/notification/PushNotificationTest.java
+6
-1
No files found.
android/app/src/main/java/com/wix/reactnativenotifications/core/notification/PushNotificationProps.java
View file @
98f3da28
...
...
@@ -21,11 +21,11 @@ public class PushNotificationProps {
}
public
String
getTitle
()
{
return
mBundle
.
getString
(
"title"
,
""
);
return
mBundle
.
getString
(
"title"
);
}
public
String
getBody
()
{
return
mBundle
.
getString
(
"body"
,
""
);
return
mBundle
.
getString
(
"body"
);
}
public
Bundle
asBundle
()
{
...
...
android/app/src/test/java/com/wix/reactnativenotifications/core/notification/PushNotificationTest.java
View file @
98f3da28
...
...
@@ -6,6 +6,8 @@ import android.app.NotificationManager;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.pm.ApplicationInfo
;
import
android.content.pm.PackageManager
;
import
android.content.res.Resources
;
import
android.os.Bundle
;
import
com.facebook.react.bridge.ReactContext
;
...
...
@@ -54,6 +56,8 @@ public class PushNotificationTest {
@Mock
private
AppLifecycleFacade
mAppLifecycleFacade
;
@Mock
private
AppLaunchHelper
mAppLaunchHelper
;
@Mock
private
JsIOHelper
mJsIOHelper
;
@Mock
private
Resources
mResources
;
@Mock
private
PackageManager
mPackageManager
;
@Before
public
void
setup
()
throws
Exception
{
...
...
@@ -68,7 +72,8 @@ public class PushNotificationTest {
ApplicationInfo
ai
=
mock
(
ApplicationInfo
.
class
);
when
(
mContext
.
getApplicationInfo
()).
thenReturn
(
ai
);
when
(
mContext
.
getResources
()).
thenReturn
(
mResources
);
when
(
mContext
.
getPackageManager
()).
thenReturn
(
mPackageManager
);
when
(
mContext
.
getSystemService
(
Context
.
NOTIFICATION_SERVICE
)).
thenReturn
(
mNotificationManager
);
}
...
...
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