Skip to content

Commit

Permalink
[Discover] Fix this time
Browse files Browse the repository at this point in the history
  • Loading branch information
jughosta committed Jul 4, 2023
1 parent c5186eb commit e96d109
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions test/functional/apps/discover/group1/_shared_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { DISCOVER_APP_LOCATOR } from '@kbn/discover-plugin/common';
import expect from '@kbn/expect';
import { compressToBase64 } from 'lz-string';
import { decompressFromBase64 } from 'lz-string';

import { FtrProviderContext } from '../ftr_provider_context';

Expand Down Expand Up @@ -75,7 +75,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

describe('permalink', function () {
it('should allow for copying the snapshot URL', async function () {
const data = {
const actualUrl = await PageObjects.share.getSharedUrl();
expect(actualUrl).to.contain(`?l=${DISCOVER_APP_LOCATOR}`);
const urlSearchParams = new URLSearchParams(actualUrl);
expect(JSON.parse(decompressFromBase64(urlSearchParams.get('lz')!)!)).to.eql({
query: {
language: 'kuery',
query: '',
Expand All @@ -94,12 +97,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
value: 60000,
pause: true,
},
};
const actualUrl = await PageObjects.share.getSharedUrl();
expect(actualUrl).to.contain(`?l=${DISCOVER_APP_LOCATOR}`);
expect(actualUrl).to.contain(
`&lz=${encodeURIComponent(compressToBase64(JSON.stringify(data)))}`
);
});
});

it('should allow for copying the snapshot URL as a short URL', async function () {
Expand Down

0 comments on commit e96d109

Please sign in to comment.