Skip to content

Commit

Permalink
Add HTML data-automation attributes for easier automation on client.
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoBernardino committed Jan 8, 2022
1 parent 21a89a8 commit 90effab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/Panels/AddExpense.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ const AddExpense = ({ budgets, reloadData }: AddExpenseProps) => {
type="number"
inputMode="decimal"
onKeyDown={onKeyDown}
data-automation="add-expense-cost"
/>

<Label>Description</Label>
Expand All @@ -181,6 +182,7 @@ const AddExpense = ({ budgets, reloadData }: AddExpenseProps) => {
autoComplete="off"
type="text"
onKeyDown={onKeyDown}
data-automation="add-expense-description"
/>

<Label>Budget</Label>
Expand All @@ -190,6 +192,7 @@ const AddExpense = ({ budgets, reloadData }: AddExpenseProps) => {
setBudget(budgets[event.target.selectedIndex].name)
}
value={budget || 'Misc'}
data-automation="add-expense-budget"
>
{budgetsToShow.map((budgetOption: T.Budget) => (
<option key={budgetOption.id} value={budgetOption.name}>
Expand All @@ -206,12 +209,14 @@ const AddExpense = ({ budgets, reloadData }: AddExpenseProps) => {
autoComplete="off"
type="date"
onKeyDown={onKeyDown}
data-automation="add-expense-date"
/>
<Button
isDisabled={isSubmitting}
onClick={() => addExpense()}
type="primary"
style={{ margin: '20px 0' }}
data-automation="add-expense-button"
>
{isSubmitting ? 'Adding...' : 'Add Expense'}
</Button>
Expand Down
3 changes: 3 additions & 0 deletions modules/auth/LoginButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const LoginButton = () => {
handleLogin();
}
}}
data-automation="login-email"
/>
<TextInput
type="password"
Expand All @@ -96,12 +97,14 @@ const LoginButton = () => {
handleLogin();
}
}}
data-automation="login-password"
/>
<Button
onClick={handleLogin}
width="large"
type="primary"
style={{ margin: '20px auto' }}
data-automation="login-button"
>
Login
</Button>
Expand Down

0 comments on commit 90effab

Please sign in to comment.