// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Application Resolver Correctly Resolves Application Query 1`] = `
Object {
  "data": Object {
    "applications": Array [
      Object {
        "_uid": "local-cluster/29a848d6-3de8-11ea-9f0f-00000a100f99",
        "applicationSet": null,
        "chart": null,
        "clusterCount": Object {
          "localCount": 1,
          "remoteCount": 2,
        },
        "created": "2020-01-23T13:56:32Z",
        "dashboard": "localhost/grafana/dashboard/db/app01-dashboard-via-federated-prometheus?namespace=sample",
        "destinationCluster": null,
        "destinationName": null,
        "destinationNamespace": null,
        "destinationServer": null,
        "hubChannels": Array [
          Object {
            "app._uid": "local-cluster/29a848d6-3de8-11ea-9f0f-00000a100f99",
            "ch._uid": "local-cluster/233dfffd-f421-44ee-811b-7f3352b2d728",
            "ch.pathname": "https://github.com/fxiang1/app-samples.git",
            "ch.type": "Git",
            "sub._gitbranch": "master",
            "sub._gitcommit": "d67d8e10dcfa41dddcac14952e9872e1dfece06f",
            "sub._gitpath": "helloworld",
            "sub._uid": "local-cluster/bdced01f-3bd4-11ea-a488-00000a100f99",
            "sub.name": "sub1",
            "sub.namespace": "default",
          },
          Object {
            "app._uid": "local-cluster/29a848d6-3de8-11ea-9f0f-00000a100f99",
            "ch._uid": "local-cluster/6c8dcb97-5e6e-4606-9b55-ae3eb05fcfb5",
            "ch.pathname": "sample-ns",
            "ch.type": "Namespace",
            "sub._uid": "local-cluster/b218636d-3d5e-11ea-8ed1-00000a100f99",
            "sub.name": "sub2",
            "sub.namespace": "default",
          },
        ],
        "hubSubscriptions": Array [
          Object {
            "_uid": "local-cluster/bdced01f-3bd4-11ea-a488-00000a100f99",
            "channel": "dev1/dev1",
            "localPlacement": true,
            "status": null,
            "timeWindow": null,
          },
          Object {
            "_uid": "local-cluster/b218636d-3d5e-11ea-8ed1-00000a100f99",
            "channel": "default/mortgage-channel",
            "localPlacement": false,
            "status": "Propagated",
            "timeWindow": "blocked",
          },
          Object {
            "_uid": "local-cluster/66426f24-3bd3-11ea-a488-00000a100f99",
            "channel": "dev1/dev1",
            "localPlacement": false,
            "status": "Propagated",
            "timeWindow": "active",
          },
        ],
        "labels": Array [
          "label1=value1",
          "label2=value2",
        ],
        "name": "app01",
        "namespace": "sample",
        "path": null,
        "repoURL": null,
        "targetRevision": null,
      },
      Object {
        "_uid": "local-cluster/app-02-uid",
        "applicationSet": null,
        "chart": null,
        "clusterCount": Object {
          "localCount": 0,
          "remoteCount": 0,
        },
        "created": "2020-01-23T13:56:32Z",
        "dashboard": "localhost/grafana/dashboard/db/app02-dashboard-via-federated-prometheus?namespace=test",
        "destinationCluster": null,
        "destinationName": null,
        "destinationNamespace": null,
        "destinationServer": null,
        "hubChannels": Array [
          Object {
            "app._uid": "local-cluster/app-02-uid",
            "ch._uid": "local-cluster/233dfffd-f421-44ee-811b-7f3352b2d728",
            "ch.pathname": "http://multiclusterhub-repo.open-cluster-management.svc.cluster.local:3000/charts",
            "ch.type": "HelmRepo",
            "sub._uid": "local-cluster/66426f24-3bd3-11ea-a488-00000a100f99",
            "sub.name": "sub3",
            "sub.namespace": "default",
            "sub.package": "application-chart",
            "sub.packageFilterVersion": "2.2.0",
          },
        ],
        "hubSubscriptions": Array [],
        "labels": Array [],
        "name": "app02",
        "namespace": "test",
        "path": null,
        "repoURL": null,
        "targetRevision": null,
      },
      Object {
        "_uid": "remote-cluster/argo-app-02-uid",
        "applicationSet": null,
        "chart": "apps",
        "clusterCount": Object {
          "localCount": 0,
          "remoteCount": 0,
        },
        "created": "2020-01-23T13:56:32Z",
        "dashboard": null,
        "destinationCluster": "remote-cluster",
        "destinationName": "in-cluster",
        "destinationNamespace": "test",
        "destinationServer": null,
        "hubChannels": Array [],
        "hubSubscriptions": Array [],
        "labels": Array [],
        "name": "argo-app02",
        "namespace": "openshift-gitops",
        "path": null,
        "repoURL": "http://multiclusterhub-repo.open-cluster-management.svc.cluster.local:3000/charts",
        "targetRevision": "1.2",
      },
      Object {
        "_uid": "local-cluster/29a848d6-3de8-11ea-9f0f-00000a100f99",
        "applicationSet": "argo-set",
        "chart": null,
        "clusterCount": Object {
          "localCount": 1,
          "remoteCount": 2,
        },
        "created": "2020-01-23T13:56:32Z",
        "dashboard": null,
        "destinationCluster": "remote-cluster",
        "destinationName": null,
        "destinationNamespace": "sample",
        "destinationServer": "https://kube.net:6443",
        "hubChannels": Array [
          Object {
            "app._uid": "local-cluster/29a848d6-3de8-11ea-9f0f-00000a100f99",
            "ch._uid": "local-cluster/233dfffd-f421-44ee-811b-7f3352b2d728",
            "ch.pathname": "https://github.com/fxiang1/app-samples.git",
            "ch.type": "Git",
            "sub._gitbranch": "master",
            "sub._gitcommit": "d67d8e10dcfa41dddcac14952e9872e1dfece06f",
            "sub._gitpath": "helloworld",
            "sub._uid": "local-cluster/bdced01f-3bd4-11ea-a488-00000a100f99",
            "sub.name": "sub1",
            "sub.namespace": "default",
          },
          Object {
            "app._uid": "local-cluster/29a848d6-3de8-11ea-9f0f-00000a100f99",
            "ch._uid": "local-cluster/6c8dcb97-5e6e-4606-9b55-ae3eb05fcfb5",
            "ch.pathname": "sample-ns",
            "ch.type": "Namespace",
            "sub._uid": "local-cluster/b218636d-3d5e-11ea-8ed1-00000a100f99",
            "sub.name": "sub2",
            "sub.namespace": "default",
          },
        ],
        "hubSubscriptions": Array [
          Object {
            "_uid": "local-cluster/bdced01f-3bd4-11ea-a488-00000a100f99",
            "channel": "dev1/dev1",
            "localPlacement": true,
            "status": null,
            "timeWindow": null,
          },
          Object {
            "_uid": "local-cluster/b218636d-3d5e-11ea-8ed1-00000a100f99",
            "channel": "default/mortgage-channel",
            "localPlacement": false,
            "status": "Propagated",
            "timeWindow": "blocked",
          },
          Object {
            "_uid": "local-cluster/66426f24-3bd3-11ea-a488-00000a100f99",
            "channel": "dev1/dev1",
            "localPlacement": false,
            "status": "Propagated",
            "timeWindow": "active",
          },
        ],
        "labels": Array [
          "label1=value1",
          "label2=value2",
        ],
        "name": "argo-app01",
        "namespace": "argocd",
        "path": "helloworld",
        "repoURL": "https://github.com/fxiang1/app-samples.git",
        "targetRevision": null,
      },
    ],
  },
}
`;

exports[`Application Resolver Correctly Resolves Single Application 1`] = `
Object {
  "data": Object {
    "applications": Array [
      Object {
        "_uid": "local-cluster/app-02-uid",
        "clusterCount": Object {
          "localCount": 0,
          "remoteCount": 0,
        },
        "created": "2020-01-23T13:56:32Z",
        "dashboard": "localhost/grafana/dashboard/db/app02-dashboard-via-federated-prometheus?namespace=test",
        "hubSubscriptions": Array [],
        "labels": Array [],
        "name": "app02",
        "namespace": "test",
      },
    ],
  },
}
`;

exports[`Application Resolver Ignores filters when only name or namespace is passed. 1`] = `
Object {
  "data": Object {
    "applications": Array [
      Object {
        "_uid": "local-cluster/29a848d6-3de8-11ea-9f0f-00000a100f99",
        "name": "app01",
      },
      Object {
        "_uid": "local-cluster/app-02-uid",
        "name": "app02",
      },
      Object {
        "_uid": "remote-cluster/argo-app-02-uid",
        "name": "argo-app02",
      },
      Object {
        "_uid": "local-cluster/29a848d6-3de8-11ea-9f0f-00000a100f99",
        "name": "argo-app01",
      },
    ],
  },
}
`;

exports[`Channel Resolver Correctly Resolves Channels Query 1`] = `
Object {
  "data": Object {
    "channels": Array [
      Object {
        "_uid": "local-cluster/ch-01-uid",
        "clusterCount": Object {
          "localCount": 1,
          "remoteCount": 2,
        },
        "created": "2020-08-20T14:16:05Z",
        "localPlacement": true,
        "name": "ch01",
        "namespace": "applications",
        "pathname": "http://multiclusterhub-repo.open-cluster-management.svc.cluster.local:3000/charts",
        "subscriptionCount": 0,
        "type": "HelmRepo",
      },
      Object {
        "_uid": "local-cluster/ch-02-uid",
        "clusterCount": Object {
          "localCount": 0,
          "remoteCount": 2,
        },
        "created": "2020-08-20T14:17:05Z",
        "localPlacement": false,
        "name": "ch02",
        "namespace": "test",
        "pathname": "https://github.com/fxiang1/app-samples.git",
        "subscriptionCount": 3,
        "type": "Git",
      },
    ],
  },
}
`;

exports[`Channel Resolver Correctly Resolves Single Channel 1`] = `
Object {
  "data": Object {
    "channels": Array [
      Object {
        "_uid": "local-cluster/ch-02-uid",
        "clusterCount": Object {
          "localCount": 0,
          "remoteCount": 2,
        },
        "created": "2020-08-20T14:17:05Z",
        "localPlacement": false,
        "name": "ch02",
        "namespace": "test",
        "pathname": "https://github.com/fxiang1/app-samples.git",
        "subscriptionCount": 3,
        "type": "Git",
      },
    ],
  },
}
`;

exports[`Channel Resolver Ignores filters when only name or namespace is passed. 1`] = `
Object {
  "data": Object {
    "channels": Array [
      Object {
        "_uid": "local-cluster/ch-01-uid",
        "name": "ch01",
      },
      Object {
        "_uid": "local-cluster/ch-02-uid",
        "name": "ch02",
      },
    ],
  },
}
`;

exports[`Placement Rule Resolver Correctly Resolves Placement Rules Query 1`] = `
Object {
  "data": Object {
    "placementRules": Array [
      Object {
        "_uid": "local-cluster/pr-01-uid",
        "clusterCount": Object {
          "localCount": 0,
          "remoteCount": 0,
        },
        "created": "2020-08-20T14:16:05Z",
        "name": "pr01",
        "namespace": "applications",
        "replicas": 3,
      },
      Object {
        "_uid": "local-cluster/pr-02-uid",
        "clusterCount": Object {
          "localCount": 0,
          "remoteCount": 0,
        },
        "created": "2020-08-20T14:17:05Z",
        "name": "pr02",
        "namespace": "test",
        "replicas": null,
      },
    ],
  },
}
`;

exports[`Placement Rule Resolver Correctly Resolves Single Placement Rule 1`] = `
Object {
  "data": Object {
    "placementRules": Array [
      Object {
        "_uid": "local-cluster/pr-01-uid",
        "clusterCount": Object {
          "localCount": 0,
          "remoteCount": 0,
        },
        "created": "2020-08-20T14:16:05Z",
        "name": "pr01",
        "namespace": "applications",
        "replicas": 3,
      },
    ],
  },
}
`;

exports[`Placement Rule Resolver Ignores filters when only name or namespace is passed. 1`] = `
Object {
  "data": Object {
    "placementRules": Array [
      Object {
        "_uid": "local-cluster/pr-01-uid",
        "name": "pr01",
      },
      Object {
        "_uid": "local-cluster/pr-02-uid",
        "name": "pr02",
      },
    ],
  },
}
`;

exports[`Subscription Resolver Correctly Resolves Single Subscription 1`] = `
Object {
  "data": Object {
    "subscriptions": Array [
      Object {
        "_uid": "local-cluster/sub-02-uid",
        "appCount": 2,
        "channel": "object-ch-ns/object-ch",
        "clusterCount": Object {
          "localCount": 0,
          "remoteCount": 2,
        },
        "created": "2020-08-20T14:17:05Z",
        "localPlacement": false,
        "name": "sub02",
        "namespace": "test",
        "status": "PropagationFailed",
        "timeWindow": null,
      },
    ],
  },
}
`;

exports[`Subscription Resolver Correctly Resolves Subscriptions Query 1`] = `
Object {
  "data": Object {
    "subscriptions": Array [
      Object {
        "_uid": "local-cluster/sub-01-uid",
        "appCount": 1,
        "channel": "git-ch-ns/git-ch",
        "clusterCount": Object {
          "localCount": 1,
          "remoteCount": 2,
        },
        "created": "2020-08-20T14:16:05Z",
        "localPlacement": true,
        "name": "sub01",
        "namespace": "applications",
        "status": "Propagated",
        "timeWindow": "blocked",
      },
      Object {
        "_uid": "local-cluster/sub-02-uid",
        "appCount": 2,
        "channel": "object-ch-ns/object-ch",
        "clusterCount": Object {
          "localCount": 0,
          "remoteCount": 2,
        },
        "created": "2020-08-20T14:17:05Z",
        "localPlacement": false,
        "name": "sub02",
        "namespace": "test",
        "status": "PropagationFailed",
        "timeWindow": null,
      },
    ],
  },
}
`;

exports[`Subscription Resolver Ignores filters when only name or namespace is passed. 1`] = `
Object {
  "data": Object {
    "subscriptions": Array [
      Object {
        "_uid": "local-cluster/sub-01-uid",
        "name": "sub01",
      },
      Object {
        "_uid": "local-cluster/sub-02-uid",
        "name": "sub02",
      },
    ],
  },
}
`;
