text: // @noflow
  import Tracker from '.'
  import * as Constants from '../constants/tracker'
  import {globalStyles} from '../styles'
  import {type Proof} from '../constants/types/tracker'
  import {type DumbComponentMap} from '../constants/types/more'
  
  const proofMaker = (type, id = 'id-') => ({
    name: type + 'user',
    type,
    id: String(id),
    state: Constants.normal,
    meta: Constants.metaNone,
    humanUrl: '',
    profileUrl: '',
    isTracked: false,
    mTime: 1469665223000,
  })
  
  const proofWeb: Proof = {
    ...proofMaker('http'),
    name: 'thelongestdomainnameintheworldandthensomeandthensomemoreandmore.com',
    humanUrl: 'thelongestdomainnameintheworldandthensomeandthensomemoreandmore.com',
  }
  const proofWeb1: Proof = {
    ...proofMaker('http', '1'),
    name: 'thelongestdomainnameintheworldandthensomeandthensomemoreandmor.com',
    meta: Constants.metaNone,
    humanUrl: 'thelongestdomainnameintheworldandthensomeandthensomemoreandmore.com',
  }
  const proofWeb2: Proof = {
    ...proofMaker('http', '2'),
    name: 'thelongestdomainnameintheworldandthensomeandthensomemoreandmo.com',
    humanUrl: 'thelongestdomainnameintheworldandthensomeandthensomemoreandmore.com',
  }
  const proofWeb3: Proof = {
    ...proofMaker('http', '3'),
    name: 'thelongestdomainnameintheworldandthensomeandthensomemoreandm.com',
    humanUrl: 'thelongestdomainnameintheworldandthensomeandthensomemoreandmore.com',
  }
  const proofWeb4: Proof = {
    ...proofMaker('http', '4'),
    name: 'thelongestdomainnameintheworldandthensomeandthensomemoreand.com',
    humanUrl: 'thelongestdomainnameintheworldandthensomeandthensomemoreandmore.com',
  }
  const proofWeb5: Proof = {
    ...proofMaker('http', '5'),
    name: 'thelongestdomainnameintheworldandthensomeandthensomemorean.com',
    humanUrl: 'thelongestdomainnameintheworldandthensomeandthensomemoreandmore.com',
  }
  const proofGithub = proofMaker('github')
  const proofTwitter: Proof = proofMaker('twitter')
  const proofFacebook: Proof = proofMaker('facebook')
  const proofHN: Proof = proofMaker('hackernews')
  const proofReddit: Proof = proofMaker('reddit')
  const proofPgp: Proof = proofMaker('pgp')
  const proofHttps: Proof = proofMaker('https')
  const proofRooter: Proof = proofMaker('rooter')
  const proofDNS: Proof = proofMaker('dns')
  
  const proofsDefault: Array<Proof> = [
    proofGithub,
    proofTwitter,
    proofFacebook,
    proofHN,
    proofRooter,
    proofReddit,
    proofPgp,
    proofHttps,
    proofDNS,
    proofWeb,
    proofWeb1,
    proofWeb2,
    proofWeb3,
    proofWeb4,
    proofWeb5,
  ]
  
  const proofsChanged: Array<Proof> = [
    {
      name: 'deleted',
      type: 'github',
      id: 'warningId',
      state: Constants.revoked,
      meta: Constants.metaDeleted,
      humanUrl: '',
      profileUrl: '',
      isTracked: false,
      mTime: 1469665223000,
    },
    {
      name: 'unreachable',
      type: 'twitter',
      id: 'unreachableId',
      state: Constants.error,
      meta: Constants.metaUnreachable,
      humanUrl: '',
      profileUrl: '',
      isTracked: false,
      mTime: 1469565223000,
    },
    {
      name: 'checking',
      type: 'twitter',
      id: 'checkingId',
      state: Constants.checking,
      meta: Constants.metaNone,
      humanUrl: '',
      profileUrl: '',
      isTracked: false,
      mTime: 1469465223000,
    },
    {
      name: 'pending',
      type: 'https',
      id: 'pendingId',
      state: Constants.checking,
      meta: Constants.metaPending,
      humanUrl: '',
      profileUrl: '',
      isTracked: false,
      mTime: 1469365223000,
    },
    {
      name: 'upgraded',
      type: 'rooter',
      id: 'upgradedId',
      state: Constants.normal,
      meta: Constants.metaUpgraded,
      humanUrl: '',
      profileUrl: '',
      isTracked: false,
      mTime: 1469265223000,
    },
  ]
  
  const propsBase = {
    closed: false,
    parentProps: {},
    currentlyFollowing: false,
    onChat: () => {},
    onFollow: () => {},
    onRefollow: () => {},
    onUnfollow: () => {},
    onClose: () => {},
    onIgnore: () => {},
    waiting: false,
    loggedIn: true,
    lastAction: null,
    loading: false,
    actionBarReady: true,
    onClickAvatar: () => console.log('on click avatar'),
    onClickFollowers: () => console.log('on click followers'),
    onClickFollowing: () => console.log('on click following'),
    errorMessage: null,
    onRetry: null,
    myUsername: 'bob',
  }
  
  const propsDefault: TrackerProps = {
    ...propsBase,
    nonUser: false,
    username: 'darksim905',
    reason: 'You accessed a private folder with gabrielh.',
    userInfo: {
      uid: '0',
      fullname: 'Gabriel Handford',
      followersCount: 1871,
      followingCount: 356,
      location: 'San Francisco, California, USA, Earth, Milky Way',
      bio:
        'Etsy photo booth mlkshk semiotics, 8-bit literally slow-carb keytar bushwick +1. Plaid migas etsy yuccie, locavore street art mlkshk lumbersexual. Literally microdosing pug disrupt iPhone raw denim, quinoa meggings kitsch. ',
      avatar: 'https://keybase.io/darksim905/picture',
      followsYou: false,
      showcasedTeams: [],
    },
    trackerState: Constants.normal,
    proofs: proofsDefault,
  
    // For hover
    headerProps: {
      onClose: () => {
        console.log('Close')
      },
    },
  }
  
  const propsNewUser: TrackerProps = {
    ...propsDefault,
  }
  
  const propsNonUser: TrackerProps = {
    ...propsDefault,
    userInfo: null,
    isPrivate: false,
    proofs: [],
    nonUser: true,
    name: 'aliceb@reddit',
    serviceName: 'reddit',
    reason: 'Success! You opened a private folder with aliceb@twitter.',
    inviteLink: 'keybase.io/inv/9999999999',
    parentProps: {
      style: {
        ...globalStyles.flexBoxColumn,
        width: 320,
        height: 470,
      },
    },
  }
  
  const propsNewUserFollowsYou: TrackerProps = {
    ...propsDefault,
    userInfo: {
      ...propsNewUser.userInfo,
      followsYou: true,
    },
  }
  
  type setFollowFilter = (p: Proof) => boolean
  function setFollow(source: TrackerProps, filter: setFollowFilter): TrackerProps {
    source.proofs = source.proofs.map(
      p =>
        filter(p)
          ? {
              ...p,
              isTracked: true,
            }
          : p
    )
    return source
  }
  
  const propsFollowing: TrackerProps = setFollow(
    {
      ...propsNewUser,
      currentlyFollowing: true,
      reason: 'You have followed gabrielh.',
      userInfo: {
        ...propsNewUser.userInfo,
        followsYou: true,
      },
      proofs: proofsDefault,
      lastAction: 'followed',
    },
    () => true
  )
  
  const propsWhatevz: TrackerProps = setFollow(
    {
      ...propsFollowing,
      reason: 'You have followed gabrielh',
      proofs: [proofGithub, {...proofTwitter, meta: Constants.metaIgnored}],
    },
    () => true
  )
  
  const propsChangedProofs: TrackerProps = {
    ...propsDefault,
    currentlyFollowing: true,
    reason: "Some of gabrielh's proofs have changed since you last followed them.",
    userInfo: {
      ...propsNewUser.userInfo,
      followsYou: true,
    },
    trackerState: Constants.error,
    proofs: proofsChanged,
  }
  
  const propsUnfollowed: TrackerProps = {
    ...propsDefault,
    reason: 'You have unfollowed gabrielh.',
    userInfo: {
      ...propsNewUser.userInfo,
      followsYou: true,
    },
    lastAction: 'unfollowed',
  }
  
  const propsLessData: TrackerProps = {
    ...propsBase,
    nonUser: false,
    username: '00',
    reason: "I'm a user with not much data.",
    userInfo: {
      fullname: 'Hi',
      uid: '0',
      bio: '',
      followersCount: 1,
      followingCount: 0,
      followsYou: false,
      avatar: 'http://placehold.it/140x140/ffffff/000000',
      location: '',
      showcasedTeams: [],
    },
    currentlyFollowing: false,
    trackerState: Constants.normal,
    proofs: [proofGithub],
  }
  
  const propsLoggedOut: TrackerProps = {
    ...propsDefault,
    loggedIn: false,
    reason: 'You accessed a public folder with gabrielh.',
  }
  const propsOneProof: TrackerProps = {...propsDefault, proofs: [proofsDefault[0]]}
  const propsFiveProof: TrackerProps = {
    ...propsDefault,
    userInfo: {
      ...propsDefault.userInfo,
      bio: 'bio',
      location: '',
    },
    proofs: [0, 1, 2, 3, 4].map(id => proofMaker('github', id)),
  }
  
  const dumbMap: DumbComponentMap<Tracker> = {
    component: Tracker,
    mocks: {
      NonuserNoLinkPrivate: {...propsNonUser, inviteLink: null, isPrivate: true},
      NonuserLink: propsNonUser,
      NonuserNoLinkPublic: {...propsNonUser, inviteLink: null},
      'Logged out': propsLoggedOut,
      'Only one proof, action bar not ready': {
        ...propsOneProof,
        actionBarReady: false,
      },
      'Only one proof': propsOneProof,
      '5 proofs': propsFiveProof,
      'New user': propsNewUser,
      // Lots of visdiff flakes
      // 'New user Scroll1': {
      // ...(propsNewUser),
      // afterMount: (c, node) => {
      // node.querySelector('.scroll-container').scrollTop = 380
      // },
      // },
      'New user Scroll2': {
        ...propsNewUser,
        afterMount: (c, node) => {
          node.querySelector('.scroll-container').scrollTop = 620
        },
      },
      'New user, follows me': propsNewUserFollowsYou,
      Followed: propsFollowing,
      "Changed/Broken proofs user you don't follow": {
        ...propsNewUserFollowsYou,
        proofs: proofsChanged,
      },
      'Changed/Broken proofs': propsChangedProofs,
      'You follow them': {
        ...propsFollowing,
        userInfo: {...propsNewUser.userInfo, followsYou: false},
      },
      Unfollowed: propsUnfollowed,
      'Barely there': propsLessData,
      'Tracker - Loading': {...propsLessData, loading: true},
      Whatevz: propsWhatevz,
      Platforms: propsWhatevz,
      'Tracker Error': {
        ...propsWhatevz,
        errorMessage: 'Failed to hit API Server',
        onRetry: () => console.log('hit retry'),
      },
    },
  }
  
  export default {
    Tracker: dumbMap,
  }
  