adds support for getToken(string,string) and deleteToken(string,string) to iid

This commit is contained in:
Case Taintor
2018-05-26 21:05:19 +02:00
parent 88e232199b
commit 3652a05848
7 changed files with 111 additions and 1 deletions

View File

@@ -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)

View 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;

View 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;

View File

@@ -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,
];
/*