@@ -25,7 +25,7 @@ describe('GCPolicy', () => {
2525
2626 it ( 'should increment and decrement endpoint and entity counts' , ( ) => {
2727 const key = 'testEndpoint' ;
28- const paths : EntityPath [ ] = [ [ 'testEntity' , '1' ] ] ;
28+ const paths : EntityPath [ ] = [ { key : 'testEntity' , pk : '1' } ] ;
2929 const countRef = gcPolicy . createCountRef ( { key, paths } ) ;
3030
3131 const decrement = countRef ( ) ;
@@ -39,7 +39,7 @@ describe('GCPolicy', () => {
3939
4040 it ( 'should dispatch GC action once no ref counts and is expired' , ( ) => {
4141 const key = 'testEndpoint' ;
42- const paths : EntityPath [ ] = [ [ 'testEntity' , '1' ] ] ;
42+ const paths : EntityPath [ ] = [ { key : 'testEntity' , pk : '1' } ] ;
4343 const state = {
4444 meta : {
4545 testEndpoint : {
@@ -74,14 +74,14 @@ describe('GCPolicy', () => {
7474 gcPolicy [ 'runSweep' ] ( ) ;
7575 expect ( controller . dispatch ) . toHaveBeenCalledWith ( {
7676 type : GC ,
77- entities : [ [ 'testEntity' , '1' ] ] ,
77+ entities : [ { key : 'testEntity' , pk : '1' } ] ,
7878 endpoints : [ 'testEndpoint' ] ,
7979 } ) ;
8080 } ) ;
8181
8282 it ( 'should dispatch GC action once no ref counts and is expired with extra decrements' , ( ) => {
8383 const key = 'testEndpoint' ;
84- const paths : EntityPath [ ] = [ [ 'testEntity' , '1' ] ] ;
84+ const paths : EntityPath [ ] = [ { key : 'testEntity' , pk : '1' } ] ;
8585 const state = {
8686 meta : {
8787 testEndpoint : {
@@ -117,14 +117,14 @@ describe('GCPolicy', () => {
117117 gcPolicy [ 'runSweep' ] ( ) ;
118118 expect ( controller . dispatch ) . toHaveBeenCalledWith ( {
119119 type : GC ,
120- entities : [ [ 'testEntity' , '1' ] ] ,
120+ entities : [ { key : 'testEntity' , pk : '1' } ] ,
121121 endpoints : [ 'testEndpoint' ] ,
122122 } ) ;
123123 } ) ;
124124
125125 it ( 'should dispatch GC action once no ref counts and no expiry state' , ( ) => {
126126 const key = 'testEndpoint' ;
127- const paths : EntityPath [ ] = [ [ 'testEntity' , '1' ] ] ;
127+ const paths : EntityPath [ ] = [ { key : 'testEntity' , pk : '1' } ] ;
128128 const state = {
129129 meta : { } ,
130130 entitiesMeta : { } ,
@@ -145,15 +145,15 @@ describe('GCPolicy', () => {
145145 gcPolicy [ 'runSweep' ] ( ) ;
146146 expect ( controller . dispatch ) . toHaveBeenCalledWith ( {
147147 type : GC ,
148- entities : [ [ 'testEntity' , '1' ] ] ,
148+ entities : [ { key : 'testEntity' , pk : '1' } ] ,
149149 endpoints : [ 'testEndpoint' ] ,
150150 } ) ;
151151 } ) ;
152152
153153 it ( 'should not dispatch GC action if expiresAt has not passed, but dispatch later when it has' , ( ) => {
154154 jest . useFakeTimers ( ) ;
155155 const key = 'testEndpoint' ;
156- const paths : EntityPath [ ] = [ [ 'testEntity' , '1' ] ] ;
156+ const paths : EntityPath [ ] = [ { key : 'testEntity' , pk : '1' } ] ;
157157 const futureTime = Date . now ( ) + 1000 ;
158158 const state = {
159159 meta : {
@@ -211,7 +211,7 @@ describe('GCPolicy', () => {
211211
212212 expect ( controller . dispatch ) . toHaveBeenCalledWith ( {
213213 type : GC ,
214- entities : [ [ 'testEntity' , '1' ] ] ,
214+ entities : [ { key : 'testEntity' , pk : '1' } ] ,
215215 endpoints : [ 'testEndpoint' ] ,
216216 } ) ;
217217
@@ -223,7 +223,7 @@ describe('GCPolicy', () => {
223223 gcPolicy = new GCPolicy ( { expiresAt : ( ) => 0 } ) ;
224224 gcPolicy . init ( controller ) ;
225225 const key = 'testEndpoint' ;
226- const paths : EntityPath [ ] = [ [ 'testEntity' , '1' ] ] ;
226+ const paths : EntityPath [ ] = [ { key : 'testEntity' , pk : '1' } ] ;
227227 const futureTime = Date . now ( ) + 1000 ;
228228 const state = {
229229 meta : {
0 commit comments