Skip to content
Permalink
Browse files

- action Not covered with tests

:goose:
  • Loading branch information...
maZahaca committed Dec 6, 2018
1 parent 1b0f9a0 commit 04f478404f871107555c3e20d480da8620b41316
Showing with 76 additions and 0 deletions.
  1. +76 −0 test/integration/actions/actions.test.js
@@ -956,6 +956,82 @@ describe('Actions', () => {
});
});

describe('ActionNot', () => {
test('perform', async () => {
setServerResponse({
html: `<a href="#">test</a>`
});
const parser = new Parser({
environment: new ChromeEnvironment({ url }),
});
const result = await parser.parse({
rules: {
actions: [
{
type: 'condition',
if: [
{
type: 'not',
actions: [
{
type: 'exists',
scope: 'span',
},
]
}
],
then: [
{
type: 'provideRules',
rules: {
scope: 'a',
},
}
],
},
],
rulesFromActions: true,
},
});

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

test('perform without or values', async () => {
setServerResponse({
html: `<a href="#">test</a>`
});
const parser = new Parser({
environment: new ChromeEnvironment({ url }),
});
const result = await parser.parse({
rules: {
actions: [
{
type: 'condition',
if: [
{
type: 'not',
}
],
then: [
{
type: 'provideRules',
rules: {
scope: 'a',
},
}
],
},
],
rulesFromActions: true,
},
});

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

describe('ActionHasRedirect', () => {
test('perform', async () => {
setServerResponse([

0 comments on commit 04f4784

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