Example #1
0
    it('returns cached id if unfetched', () => {
      const id = 'client:1';
      const cachedRootCallMap = {viewer: {'': id}};
      const rootCallMap = {};
      const records = {};

      const store = new RelayRecordStore(
        {records},
        {rootCallMap, cachedRootCallMap}
      );
      expect(store.getDataID('viewer')).toBe(id);
    });
Example #2
0
 it('returns undefined if unfetched and not cached', () => {
   const records = {};
   const store = new RelayRecordStore({records});
   expect(store.getDataID('viewer')).toBe(undefined);
 });