Skip to content

Commit

Permalink
Fix circular dependencies e2e test (#12)
Browse files Browse the repository at this point in the history
* Fix circular dependencies e2e test

* screenshots

Co-authored-by: Gal Havivi <gal.havivi@oath.com>
  • Loading branch information
galhavivi and Gal Havivi authored Oct 29, 2021
1 parent 46776fb commit 4c4d6b4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
Binary file modified packages/react-form/e2e-logs/testHomepageNavigation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/react-form/e2e-logs/testReactDemos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,33 @@
*/

import {
testInput, CORE_CYCLE_TIME,
getInput, isDataViewerContains, CORE_CYCLE_TIME,
} from '../../../e2e.utils';

export default async function (page) {
// wait for circular loop to stop
await waitForAsyncToRender(page);

// Fields do not appear because init form action failed
// and the action reverted to the prev form snapshot.

// Field with id "first"
let id = 'first';
let leafPath = 'first';
let initialValue = 'aaaa';
await testInput(page, id, leafPath, initialValue, null);
let initialValue = '';
let input = await getInput(page, id, initialValue);
expect(input).toBeFalsy();
let exists = await isDataViewerContains(page, leafPath, initialValue);
expect(exists).toBeTruthy();

// Field with id "second" - as expected
// Field with id "second"
id = 'second';
leafPath = 'second';
initialValue = 'bbbbb';
await testInput(page, id, leafPath, initialValue, null);
initialValue = '';
input = await getInput(page, id, initialValue);
expect(input).toBeFalsy();
exists = await isDataViewerContains(page, leafPath, initialValue);
expect(exists).toBeTruthy();
}

async function waitForAsyncToRender(page) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
export default {
first: '',
second: '',
};
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export default {
firstDependenciesChange: {
func: props => ({ value: `${props.value}a` }),
func: ({ value = '' }) => ({ value: `${value}a` }),
},
secondDependenciesChange: {
func: props => ({ value: `${props.value}b` }),
func: ({ value = '' }) => ({ value: `${value}b` }),
},
};

0 comments on commit 4c4d6b4

Please sign in to comment.