Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
AloqaIM-Android
Commits
4a534c96
Commit
4a534c96
authored
Aug 24, 2018
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ChatRoomFragment.kt
parent
b4bc6fef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
ChatRoomFragmentTest.kt
...a/chat/rocket/android/chatroom/ui/ChatRoomFragmentTest.kt
+16
-7
No files found.
app/src/androidTest/java/chat/rocket/android/chatroom/ui/ChatRoomFragmentTest.kt
View file @
4a534c96
...
...
@@ -24,35 +24,44 @@ class ChatRoomFragmentTest {
@Before
fun
stubAllExternalIntents
()
{
val
activityIntent
=
InstrumentationRegistry
.
getTargetContext
().
chatRoomIntent
(
"id"
,
"name"
,
"type"
,
false
,
0L
)
val
activityIntent
=
InstrumentationRegistry
.
getTargetContext
()
.
chatRoomIntent
(
"id"
,
"name"
,
"type"
,
false
,
0L
)
activityRule
.
launchActivity
(
activityIntent
)
intending
(
not
(
isInternal
())).
respondWith
(
ActivityResult
(
Activity
.
RESULT_OK
,
null
))
}
@Test
fun
showFileSelection_nonNullFiltersAreApplied
()
{
val
fragment
=
activityRule
.
activity
.
supportFragmentManager
.
findFragmentByTag
(
ChatRoomActivity
.
TAG_CHAT_ROOM_FRAGMENT
)
as
ChatRoomFragment
val
fragment
=
activityRule
.
activity
.
supportFragmentManager
.
findFragmentByTag
(
"ChatRoomFragment"
)
as
ChatRoomFragment
val
filters
=
arrayOf
(
"image/*"
)
fragment
.
showFileSelection
(
filters
)
intended
(
allOf
(
intended
(
allOf
(
hasAction
(
Intent
.
ACTION_GET_CONTENT
),
hasType
(
"*/*"
),
hasCategories
(
setOf
(
Intent
.
CATEGORY_OPENABLE
)),
hasExtra
(
Intent
.
EXTRA_MIME_TYPES
,
filters
)))
hasExtra
(
Intent
.
EXTRA_MIME_TYPES
,
filters
)
)
)
}
@Test
fun
showFileSelection_nullFiltersAreNotApplied
()
{
val
fragment
=
activityRule
.
activity
.
supportFragmentManager
.
findFragmentByTag
(
ChatRoomActivity
.
TAG_CHAT_ROOM_FRAGMENT
)
as
ChatRoomFragment
val
fragment
=
activityRule
.
activity
.
supportFragmentManager
.
findFragmentByTag
(
"ChatRoomFragment"
)
as
ChatRoomFragment
fragment
.
showFileSelection
(
null
)
intended
(
allOf
(
intended
(
allOf
(
hasAction
(
Intent
.
ACTION_GET_CONTENT
),
hasType
(
"*/*"
),
hasCategories
(
setOf
(
Intent
.
CATEGORY_OPENABLE
)),
not
(
hasExtraWithKey
(
Intent
.
EXTRA_MIME_TYPES
))))
not
(
hasExtraWithKey
(
Intent
.
EXTRA_MIME_TYPES
))
)
)
}
}
\ No newline at end of file
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