_skip.key_value.test.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. import qs from 'querystringify';
  20. import { waitForChartLoad } from 'cypress/utils';
  21. import { WORLD_HEALTH_DASHBOARD } from 'cypress/utils/urls';
  22. import { WORLD_HEALTH_CHARTS } from './utils';
  23. interface QueryString {
  24. native_filters_key: string;
  25. }
  26. describe.skip('nativefilter url param key', () => {
  27. // const urlParams = { param1: '123', param2: 'abc' };
  28. let initialFilterKey: string;
  29. it('should have cachekey in nativefilter param', () => {
  30. // things in `before` will not retry and the `waitForChartLoad` check is
  31. // especially flaky and may need more retries
  32. cy.visit(WORLD_HEALTH_DASHBOARD);
  33. WORLD_HEALTH_CHARTS.forEach(waitForChartLoad);
  34. cy.wait(1000); // wait for key to be published (debounced)
  35. cy.location().then(loc => {
  36. const queryParams = qs.parse(loc.search) as QueryString;
  37. expect(typeof queryParams.native_filters_key).eq('string');
  38. });
  39. });
  40. it('should have different key when page reloads', () => {
  41. cy.visit(WORLD_HEALTH_DASHBOARD);
  42. WORLD_HEALTH_CHARTS.forEach(waitForChartLoad);
  43. cy.wait(1000); // wait for key to be published (debounced)
  44. cy.location().then(loc => {
  45. const queryParams = qs.parse(loc.search) as QueryString;
  46. expect(queryParams.native_filters_key).not.equal(initialFilterKey);
  47. });
  48. });
  49. });