mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-26 23:05:11 +08:00
adds support for getToken(string,string) and deleteToken(string,string) to iid
This commit is contained in:
@@ -225,7 +225,7 @@ PODS:
|
||||
- React/Core
|
||||
- React/fishhook
|
||||
- React/RCTBlob
|
||||
- RNFirebase (4.1.0):
|
||||
- RNFirebase (4.2.0):
|
||||
- Firebase/Core
|
||||
- React
|
||||
- yoga (0.54.4.React)
|
||||
|
||||
35
tests/src/tests/iid/iidTests.js
Normal file
35
tests/src/tests/iid/iidTests.js
Normal file
@@ -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;
|
||||
10
tests/src/tests/iid/index.js
Normal file
10
tests/src/tests/iid/index.js
Normal file
@@ -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;
|
||||
@@ -12,6 +12,7 @@ import performance from './perf';
|
||||
import admob from './admob';
|
||||
import firestore from './firestore';
|
||||
import links from './links/index';
|
||||
import iid from './iid';
|
||||
|
||||
window.getCoverage = function getCoverage() {
|
||||
return JSON.stringify(global.__coverage__);
|
||||
@@ -31,6 +32,7 @@ const testSuiteInstances = [
|
||||
performance,
|
||||
storage,
|
||||
links,
|
||||
iid,
|
||||
];
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user