If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Problem
Violations were implemented under a beta and we're ready to release this functionality to everyone
Solution
- Remove all the code in the front end using the violations beta, and run a thorough set of manual tests to make sure everything is working as designed.
- The proposal should outline all the places in the code we need to update
- The proposed test script is below, and both online and offline tests should be done on every platform
(related https://github.com/Expensify/Expensify/issues/338701)
Tests
Pre-testing steps
- Make sure emails sent to the testing email addresses go to an inbox you can access to validate your account(s)
- Create a new workspace in new dot and go to the workspace settings
- From the members tab, invite an additional user to the policy
- From the More Features tab, enable categories and tags
- From the Categories tab, add at least 2 categories, click settings, and switch on “Members must categorize all expenses”
- From the Tags tab, add at least 2 tags, click settings, and switch on “Members must tag all expenses”
Important Notes
- Only the violations related to tags and categories work while offline. That means if you have a missing tag or missing category violation, you’re offline, and you update the tag or category, the violation should disappear. Similarly, if you’re online, the violation should disappear right away.
- For other violations, you’ll need to wait for the API to return a response and update the transaction violations.
- Some tests ask to verify that the report preview looks correct. If you're on the case of a single-expense report, where we put a money request preview directly in the workspace chat (as oppposed to workspace chat having report previews, and reports having money request previews), you can add a second expense to the report and then verify the report preview, or omit the step and verify the money request preview
- If you find any steps need to be updated, please let us know so we can update our testing script
Missing tag and missing category violations
Manual Request
- Press big plus sign > submit expense
- Select Manual tab (from Manual | Scan | Distance)
- Enter amount and press next
- Press the workspace from the pre-testing steps (press the row, not the split button in the row)
- Press the show more button if it’s there
- Enter a merchant
- Press the Request $X.XX button
- Repeat steps 1-7
- Press the report preview
- Press the first money request preview
- Press the category row
- Press on a category
- Press the Tag row
- Press on a tag
- Press on the IOU chat report link at the top
- Press on the second money request view
- Repeat steps 11-15
- Press on the IOU chat report link at the top
- Press on the policy expense chat report link at the top
- 🛜 Repeats all these steps while offline
Scan Request
- Same as the Manual Request test above, replacing steps 2 and 3 with the following
- Select Scan tab (from Manual | Scan | Distance)
- Press choose file, select an image
- Press the workspace from the pre-testing steps (press the row, not the split button in the row)
- Press the Submit expense button
- Continue from the verification of step 8 above, and once done, repeat all these steps while offline 🛜
Distance Request
- Same as the Manual Request test above, replacing steps 2 and 3 with the following
- Select Distance tab (from Manual | Scan | Distance)
- Press Start and enter an address, eg 88 Kearny st. Then Press Finish and enter an address, eg, 1180 jackson st. And press Next
- Continue from step 4 above, and once done, repeat all these steps while offline 🛜
Category out of policy, tag out of policy violation, expense over limit, max age, over category limit, receipt required
Manual Request
- In old dot, in the workspace editor > expenses tab, set max expense age to 5, max expense amount to $10, receipt required amount to $5
- In the workspace editor > categories tab, set the max amount for one of the categories to $3
- On new dot, press big plus sign > submit expense
- Select Manual tab (from Manual | Scan | Distance)
- Enter $15 as the amount amount and press next
- Press the workspace from the pre-testing steps
- Press the show more button
- Press the Date row, and set the date to be more than 5 days ago
- Press the category row, select a category that doesn’t have a max amount
- Press the tag row, select a tag
- Enter a merchant
- Press the Submit $15 button
- If you have more than one expense
- Press the report preview
- Press the report preview or money request preview (depending on the number of expenses)
- Press the category row, and select the category with max amount set to $3
- On a different tab, sign into old dot as an admin of the workspace where the money request was created
- Go to the policy editor, and disable the category and the tag you added to the money request
- Switch back to new dot, and refresh the page
- Switch back to old dot, re-enable the category and tag you had disabled, remove the max amount from the category, and from the expenses tab, remove the values from the Max Expense Age (Days), Max Expense Amount and Receipt Required Amount fields
- Switch back to new dot, and refresh the page
- Repeat steps 1-3 in old dot
- 🛜 Switch to new dot and go offline
- Repeat steps 1-14. The report preview, money request preview should be grayed out
- Go online, and repeat steps 15-21
Scan Request
- Same as the Manual Request test above, replacing steps 4 and 5 with the following
- Select Scan tab (from Manual | Scan | Distance)
- Press choose file, select an image
- Press the workspace from the pre-testing steps
- Press the Request button
- Continue from the verification of step 13 above, and once done, repeat all these steps while offline 🛜
Distance Request
- Same as the Manual Request test above, replacing steps 4 and 5 with the following
- Select Distance tab (from Manual | Scan | Distance)
- Press Start and enter an address, eg 88 Kearny st. Then Press Finish and enter an address, eg, 1180 jackson st. And press Next
- Continue from step 6 above, and once done, repeat all these steps while offline 🛜
Tag violations on workspace with Independent Tags (multi-level tags)
Manual Request
- In old dot, in the workspace editor > tags tab, switch on the Use multiple levels of tags toggle
- Click import from spreadsheet, and upload the file in this issue comment
- On new dot, press big plus sign > submit expense
- Select Manual tab (from Manual | Scan | Distance)
- Enter $15 as the amount amount and press next
- Press the workspace from the pre-testing steps (press the row, not the split button in the row)
- Press the merchant row and enter a merchant
- Press the Submit $15 button
- Confirm the report preview has a red circle
- Press the report preview
- If the report has more than 1 expense
- Press the money request preview
- Press the Region menu item, and select a region
- Repeat for Department and Project
- Press the Region menu item, and unselect the selected region
- 🛜 Switch to new dot and go offline
- Repeat steps 1-16. The report preview, money request preview should be grayed out
- Go online, and confirm everything looks the same, except nothing is grayed out
- Submit a new expense on the same workspace, and select all the required fields so there are no violation on that expense
- Click on the link in the transaction thread header to go back to the expense report if you didn’t land there already
Tag violations on workspace with Dependent Tags (multi-level tags)
Manual Request
- In old dot, in the workspace editor > tags tab, switch on the Use multiple levels of tags and the People must tag expenses toggles
- Click import from spreadsheet, uncheck “Are these independent tags?”, and upload the file in this issue comment
- On new dot, press big plus sign > submit expense
- Select Manual tab (from Manual | Scan | Distance)
- Enter $15 as the amount amount and press next
- Press the workspace from the pre-testing steps (press the row, not the split button in the row)
- Press the merchant row and enter a merchant
- Press the Submit $15 button
- Confirm the report preview has a red circle
- Press the report preview
- If the report has more than 1 expense
- Press the money request preview
- Press the Region menu item, and select a region
- Select a State
- Select a City
- De-select City
- 🛜 Switch to new dot and go offline
- Repeat steps 1-16. The report preview, money request preview should be grayed out
- Go online, and confirm everything looks the same, except nothing is grayed out
- Submit a new expense on the same workspace, and select all the required fields so there are no violation on that expense
- Click on the link in the transaction thread header to go back to the expense report if you didn’t land there already
- Go to the workspace settings for the workspace you’re using
- From the Categories tab switch off “Members must categorize all expenses”
- From the Tags tab switch off “Members must tag all expenses”
Receipt Audit Scan
- Press big plus sign > submit expense
- Select Scan tab (from Manual | Scan | Distance)
- Press choose file and upload the popbagel.pdf file in this issue comment
- Select the workspace to submit to
- Wait for it to scan, it should be quick since we have a parser for square receipts
- Update the amount to $25
- Click the blue link in the report header
- If there aren’t any other expenses on the report you added the receipt to, submit another expense on the same workspace
- Navigate to the expense report
Receipt Audit Distance
- Press big plus sign > submit expense
- Select Distance tab (from Manual | Scan | Distance)
- Press Start and enter an address, eg 88 Kearny st. Then Press Finish and enter an address, eg, 1180 jackson st. And press Next
- Select the workspace to submit to
- Click Submit $XX button
- Update the amount to $7
- Click the blue link in the report header
- If there aren’t any other expenses on the report you added the receipt to, submit another expense on the same workspace
- Navigate to the expense report
- Import a third party domain control card via OldDot
- Find the card transaction in the workspace chat corresponding to the assigned employee, or visit the Search page and find the transaction by date.
- Open the card expense
- Change the amount of the card transaction to an amount higher than the original charge
- Verify that you see “Amount greater than scanned receipt”
- Verify that you see “Receipt * Issue found 🔴” above the receipt
- Navigate back to the transaction/expense preview.
- Verify that you see “Review required 🔴" in the Request Preview
Receipt Audit - Receipt Not Verified
- Press big plus sign > submit expense
- Select Scan tab (from Manual | Scan | Distance)
- Press choose file and upload a bad receipt. You can take a screenshot of a blank space on your screen and upload that
- Select the workspace to submit to
- Wait for it to scan, it should fail
- Add an amount and a merchant
cc @JmillsExpensify
View all open jobs on GitHub
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~01e029ffdb5d51f383
- Upwork Job ID: 1810382758841290536
- Last Price Increase: 2024-07-08
- Automatic offers:
- ShridharGoel | Contributor | 103067321
Issue Owner
Current Issue Owner: @JmillsExpensify
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Problem
Violations were implemented under a beta and we're ready to release this functionality to everyone
Solution
(related https://github.com/Expensify/Expensify/issues/338701)
Tests
Pre-testing steps
Important Notes
Missing tag and missing category violations
Manual Request
Scan Request
Distance Request
Category out of policy, tag out of policy violation, expense over limit, max age, over category limit, receipt required
Manual Request
Scan Request
Distance Request
Tag violations on workspace with Independent Tags (multi-level tags)
Manual Request
Tag violations on workspace with Dependent Tags (multi-level tags)
Manual Request
Switch off requirement for tags and categories
For the next tests, stop requiring tags and categories so you can focus on receipt related violations
Receipt Audit Scan
Receipt Audit Distance
Receipt Audit Card (Amount greater than card transaction)
Receipt Audit - Receipt Not Verified
cc @JmillsExpensify
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @JmillsExpensify