
- name: no_session_level_filters
  description: Query without session-level filters (should route to optimized pipe)
  parameters: site_uuid=mock_site_uuid&date_from=2100-01-01&date_to=2100-01-07&timezone=Etc/UTC
  expected_result: |
    {"post_uuid":"6b8635fb-292f-4422-9fe4-d76cfab2ba31","pathname":"\/blog\/hello-world\/","visits":9}
    {"post_uuid":"06b1b0c9-fb53-4a15-a060-3db3fde7b1fc","pathname":"\/about\/","visits":8}
    {"post_uuid":"","pathname":"\/","visits":7}
    {"post_uuid":"06b1b0c9-fb53-4a15-a060-3db3fde7b1dd","pathname":"\/blog\/hello-world\/","visits":1}

- name: pathname_filter
  description: Query with pathname filter (should route to optimized pipe)
  parameters: site_uuid=mock_site_uuid&date_from=2100-01-01&date_to=2100-01-07&timezone=Etc/UTC&pathname=%2Fabout%2F
  expected_result: |
    {"post_uuid":"06b1b0c9-fb53-4a15-a060-3db3fde7b1fc","pathname":"\/about\/","visits":8}

- name: post_uuid_filter
  description: Query with post_uuid filter (should route to optimized pipe)
  parameters: site_uuid=mock_site_uuid&date_from=2100-01-01&date_to=2100-01-07&timezone=Etc/UTC&post_uuid=6b8635fb-292f-4422-9fe4-d76cfab2ba31
  expected_result: |
    {"post_uuid":"6b8635fb-292f-4422-9fe4-d76cfab2ba31","pathname":"\/blog\/hello-world\/","visits":9}

- name: device_filter
  description: Query with device filter routes to api_top_pages
  parameters: site_uuid=mock_site_uuid&date_from=2100-01-01&date_to=2100-01-07&timezone=Etc/UTC&device=desktop
  expected_result: |
    {"post_uuid":"06b1b0c9-fb53-4a15-a060-3db3fde7b1fc","pathname":"\/about\/","visits":8}
    {"post_uuid":"6b8635fb-292f-4422-9fe4-d76cfab2ba31","pathname":"\/blog\/hello-world\/","visits":8}
    {"post_uuid":"","pathname":"\/","visits":7}
    {"post_uuid":"06b1b0c9-fb53-4a15-a060-3db3fde7b1dd","pathname":"\/blog\/hello-world\/","visits":1}

- name: location_filter
  description: Query with location filter routes to api_top_pages
  parameters: site_uuid=mock_site_uuid&date_from=2100-01-01&date_to=2100-01-07&timezone=Etc/UTC&location=GB
  expected_result: |
    {"post_uuid":"6b8635fb-292f-4422-9fe4-d76cfab2ba31","pathname":"\/blog\/hello-world\/","visits":6}
    {"post_uuid":"06b1b0c9-fb53-4a15-a060-3db3fde7b1fc","pathname":"\/about\/","visits":4}
    {"post_uuid":"","pathname":"\/","visits":4}

- name: source_filter
  description: Query with source filter routes to api_top_pages
  parameters: site_uuid=mock_site_uuid&date_from=2100-01-01&date_to=2100-01-07&timezone=Etc/UTC&source=bing.com
  expected_result: |
    {"post_uuid":"06b1b0c9-fb53-4a15-a060-3db3fde7b1fc","pathname":"\/about\/","visits":2}
    {"post_uuid":"","pathname":"\/","visits":1}
    {"post_uuid":"6b8635fb-292f-4422-9fe4-d76cfab2ba31","pathname":"\/blog\/hello-world\/","visits":1}

- name: utm_source_filter
  description: Query with utm_source filter routes to api_top_pages
  parameters: site_uuid=mock_site_uuid&date_from=2100-01-01&date_to=2100-01-07&timezone=Etc/UTC&utm_source=google
  expected_result: |
    {"post_uuid":"6b8635fb-292f-4422-9fe4-d76cfab2ba31","pathname":"\/blog\/hello-world\/","visits":2}
    {"post_uuid":"06b1b0c9-fb53-4a15-a060-3db3fde7b1dd","pathname":"\/blog\/hello-world\/","visits":1}

- name: date_from_only
  description: Query with only date_from (no date_to) routes to v3 without error (fixture data is far into the future)
  parameters: site_uuid=mock_site_uuid&date_from=2100-01-01&timezone=Etc/UTC
  expected_result: ''

- name: date_to_only
  description: Query with only date_to (no date_from) routes to v3 and returns all
    data up to date_to
  parameters: site_uuid=mock_site_uuid&date_to=2100-01-07&timezone=Etc/UTC
  expected_result: |
    {"post_uuid":"6b8635fb-292f-4422-9fe4-d76cfab2ba31","pathname":"\/blog\/hello-world\/","visits":9}
    {"post_uuid":"06b1b0c9-fb53-4a15-a060-3db3fde7b1fc","pathname":"\/about\/","visits":8}
    {"post_uuid":"","pathname":"\/","visits":7}
    {"post_uuid":"06b1b0c9-fb53-4a15-a060-3db3fde7b1dd","pathname":"\/blog\/hello-world\/","visits":1}

- name: no_date_filters
  description: Query with no date filters routes to v3 without error (date_to defaults
    to now and fixture data is far into the future)
  parameters: site_uuid=mock_site_uuid&timezone=Etc/UTC
  expected_result: ''
