Skip to content

Commit

Permalink
add test for legacy short url support
Browse files Browse the repository at this point in the history
  • Loading branch information
vadimkibana committed Sep 26, 2021
1 parent b424598 commit 0ded7fa
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/api_integration/apis/short_url/get_short_url/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,30 @@ export default function ({ getService }: FtrProviderContext) {

expect(response2.body).to.eql(response1.body);
});

it('supports legacy short URLs', async () => {
const id = 'abcdefghjabcdefghjabcdefghjabcdefghj';
await supertest.post('/api/saved_objects/url/' + id).send({
attributes: {
accessCount: 25,
accessDate: 1632672537546,
createDate: 1632672507685,
url: '/app/dashboards#/view/123',
},
});
const response = await supertest.get('/api/short_url/' + id);
await supertest.delete('/api/saved_objects/url/' + id).send();

expect(response.body.id).to.be(id);
expect(response.body.slug).to.be(id);
expect(response.body.locator).to.eql({
id: 'LEGACY_SHORT_URL_LOCATOR',
version: '7.15.0',
state: { url: '/app/dashboards#/view/123' },
});
expect(response.body.accessCount).to.be(25);
expect(response.body.accessDate).to.be(1632672537546);
expect(response.body.createDate).to.be(1632672507685);
});
});
}

0 comments on commit 0ded7fa

Please sign in to comment.