export default function mockTokenRetrieve () {
  if (typeof global.window === 'undefined') global.window = {}
  let listener = null
  global.window.addEventListener = (n, l) => { listener = l }
  global.window.removeEventListener = () => null
  global.window.parent = {}
  global.window.parent.postMessage = function (payload, origin) {
    if (payload.action === 'getToken') {
      listener({
        data: {
          appName: process.env.NAME,
          token: process.env.TOKEN
        }
      })
    }
  }
}

@@ -264,16 +264,70 @@
 nt = %7B%7D%0A
+  global.window.location = %7Borigin: 'fakecozy.local'%7D%0A
   global
@@ -421,16 +421,47 @@
 etToken'
+ && origin === 'fakecozy.local'
 ) %7B%0A    

fix test with new origin