File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,28 @@ describe('store: [adapter=DOMAIN]', () => {
212212 } ) ;
213213 } ) ;
214214
215+ describe ( 'getShortId()' , ( ) => {
216+ it ( 'should return short (8 chars) unique value if store is initialized.' , done => {
217+ const callback = ( ) => {
218+ expect ( globalStore . getShortId ( ) ) . to . be . an ( 'string' ) ;
219+ expect ( globalStore . getShortId ( ) ) . to . not . equal ( null ) ;
220+ expect ( globalStore . getShortId ( ) ) . to . not . equal ( undefined ) ;
221+ expect ( globalStore . getShortId ( ) ) . to . be . lengthOf ( 8 ) ;
222+
223+ done ( ) ;
224+ } ;
225+
226+ globalStore . initialize ( adapter ) ( callback ) ;
227+ } ) ;
228+
229+ it ( 'should return `undefined` if store is not initialized.' , done => {
230+ expect ( globalStore . getShortId ) . to . not . throw ( ) ;
231+ expect ( globalStore . getShortId ( ) ) . to . equal ( undefined ) ;
232+
233+ done ( ) ;
234+ } ) ;
235+ } ) ;
236+
215237 describe ( 'find()' , ( ) => {
216238 it ( 'should successfully return value in synchronous callback.' , done => {
217239 const callback = ( ) => {
You can’t perform that action at this time.
0 commit comments