Skip to content
Snippets Groups Projects
Commit a57327ad authored by Daniel Sandu's avatar Daniel Sandu
Browse files

feat: Add data-test-id's for automation testing

parent 1eaa072c
No related branches found
No related tags found
2 merge requests!110Sprint 21 Features,!94Hin 979
...@@ -158,6 +158,7 @@ const AuthorEdit = ({ ...@@ -158,6 +158,7 @@ const AuthorEdit = ({
<Label required>Email</Label> <Label required>Email</Label>
<ValidatedField <ValidatedField
component={TextField} component={TextField}
data-test-id="author-card-email"
name="email" name="email"
validate={[required, validators.emailValidator]} validate={[required, validators.emailValidator]}
/> />
...@@ -166,6 +167,7 @@ const AuthorEdit = ({ ...@@ -166,6 +167,7 @@ const AuthorEdit = ({
<Label required>First name</Label> <Label required>First name</Label>
<ValidatedField <ValidatedField
component={TextField} component={TextField}
data-test-id="author-card-firstname"
name="firstName" name="firstName"
validate={[required]} validate={[required]}
/> />
...@@ -174,6 +176,7 @@ const AuthorEdit = ({ ...@@ -174,6 +176,7 @@ const AuthorEdit = ({
<Label required>Last name</Label> <Label required>Last name</Label>
<ValidatedField <ValidatedField
component={TextField} component={TextField}
data-test-id="author-card-lastname"
name="lastName" name="lastName"
validate={[required]} validate={[required]}
/> />
...@@ -182,6 +185,7 @@ const AuthorEdit = ({ ...@@ -182,6 +185,7 @@ const AuthorEdit = ({
<Label required>Affiliation</Label> <Label required>Affiliation</Label>
<ValidatedField <ValidatedField
component={TextField} component={TextField}
data-test-id="author-card-affiliation"
name="affiliation" name="affiliation"
validate={[required]} validate={[required]}
/> />
...@@ -192,6 +196,7 @@ const AuthorEdit = ({ ...@@ -192,6 +196,7 @@ const AuthorEdit = ({
component={input => ( component={input => (
<Menu {...input} options={countries} placeholder="Please select" /> <Menu {...input} options={countries} placeholder="Please select" />
)} )}
data-test-id="author-card-country"
name="country" name="country"
/> />
</Item> </Item>
......
...@@ -101,6 +101,7 @@ const SortableList = ({ ...@@ -101,6 +101,7 @@ const SortableList = ({
<Fragment> <Fragment>
{items.map((item, i) => ( {items.map((item, i) => (
<DecoratedItem <DecoratedItem
data-test-id={`add-author-id-${i}`}
dragHandle={dragHandle} dragHandle={dragHandle}
index={i} index={i}
item={item} item={item}
......
...@@ -73,7 +73,11 @@ const WizardAuthors = ({ ...@@ -73,7 +73,11 @@ const WizardAuthors = ({
<Row alignItems="center" justify="flex-start"> <Row alignItems="center" justify="flex-start">
<Item> <Item>
<Label>Authors</Label> <Label>Authors</Label>
<ActionLink icon="plus" onClick={addNewAuthor}> <ActionLink
data-test-id="add-author"
icon="plus"
onClick={addNewAuthor}
>
ADD AUTHOR ADD AUTHOR
</ActionLink> </ActionLink>
</Item> </Item>
......
...@@ -32,8 +32,10 @@ const MultiAction = ({ ...@@ -32,8 +32,10 @@ const MultiAction = ({
<Spinner size={3} /> <Spinner size={3} />
) : ( ) : (
<Fragment> <Fragment>
<Button onClick={onClose}>{cancelText}</Button> <Button data-test-id="modal-cancel" onClick={onClose}>
<Button onClick={onConfirm} primary> {cancelText}
</Button>
<Button data-test-id="modal-confirm" onClick={onConfirm} primary>
{confirmText} {confirmText}
</Button> </Button>
</Fragment> </Fragment>
......
...@@ -21,7 +21,7 @@ const SingleActionModal = ({ ...@@ -21,7 +21,7 @@ const SingleActionModal = ({
</Icon> </Icon>
{title && <H2>{title}</H2>} {title && <H2>{title}</H2>}
{subtitle && <Text secondary>{subtitle}</Text>} {subtitle && <Text secondary>{subtitle}</Text>}
<Button onClick={onClick} primary> <Button data-test-id="modal-confirm" onClick={onClick} primary>
{confirmText} {confirmText}
</Button> </Button>
</Root> </Root>
......
...@@ -45,7 +45,12 @@ const Users = ({ ...@@ -45,7 +45,12 @@ const Users = ({
<Fragment> <Fragment>
<Row alignItems="center" justify="space-between" mb={1}> <Row alignItems="center" justify="space-between" mb={1}>
<Item alignItems="center"> <Item alignItems="center">
<ActionLink icon="arrow-left" mr={2} onClick={history.goBack}> <ActionLink
data-test-id="go-to-dashboard"
icon="arrow-left"
mr={2}
onClick={history.goBack}
>
Admin Dashboard Admin Dashboard
</ActionLink> </ActionLink>
<AddUser <AddUser
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment