forked from invertase/react-native-firebase
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds support for getToken(string,string) and deleteToken(string,strin…
…g) to iid
- Loading branch information
Showing
7 changed files
with
111 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import should from 'should'; | ||
|
||
function iidTests({ describe, it, firebase }) { | ||
describe('iid', () => { | ||
it('should delete the iid token', async () => { | ||
await firebase.native.iid().delete(); | ||
}); | ||
|
||
it('it should return iid token from get', async () => { | ||
const token = await firebase.native.iid().get(); | ||
|
||
token.should.be.a.String(); | ||
}); | ||
|
||
it('should return an FCM token from getToken with arguments', async () => { | ||
await firebase.native.iid().delete(); | ||
|
||
const otherSenderIdToken = await firebase.native | ||
.iid() | ||
.getToken('305229645282', '*'); | ||
|
||
otherSenderIdToken.should.be.a.String(); | ||
}); | ||
|
||
it('should return nil from deleteToken', async () => { | ||
const token = await firebase.native | ||
.iid() | ||
.deleteToken('305229645282', '*'); | ||
|
||
should.not.exist(token); | ||
}); | ||
}); | ||
} | ||
|
||
export default iidTests; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import firebase from '../../firebase'; | ||
import TestSuite from '../../../lib/TestSuite'; | ||
|
||
import iidTests from './iidTests'; | ||
|
||
const suite = new TestSuite('Iid', 'firebase.id()', firebase); | ||
|
||
suite.addTests(iidTests); | ||
|
||
export default suite; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters