Skip to content
Permalink
Browse files

- action hasRedirect has been added to tests

:goose:
  • Loading branch information...
maZahaca committed Dec 4, 2018
1 parent 3c34ffb commit 24e8dec79e59ee17f7c7042dabd43c72d08d54f3
Showing with 50 additions and 0 deletions.
  1. +50 −0 test/integration/actions/actions.test.js
@@ -824,6 +824,56 @@ describe('Actions', () => {
});
});

describe('ActionHasRedirect', () => {
test('perform', async () => {
setServerResponse([
{
html: ``,
headers: [
{
name: "Location",
value: `${url}test`,
}
],
code: 302,
route: '/'
},
{
route: '/test',
html: `<span>test</span>`,
}
]);
const parser = new Parser({
environment: new ChromeEnvironment({ url }),
});
const result = await parser.parse({
rules: {
actions: [
{
type: 'condition',
if: [
{
type: "hasRedirect"
}
],
then: [
{
type: 'provideRules',
rules: {
scope: 'span',
},
}
],
},
],
rulesFromActions: true,
},
});

expect(result).toEqual('test');
});
});

// describe('ActionSnapshot', () => {
// test('making page snapshot', async () => {
// setServerResponse({

0 comments on commit 24e8dec

Please sign in to comment.
You can’t perform that action at this time.