<Meta title="Documentation/Standards/Testing/Overview"/>

# Testing – An Overview

| Test Level        | Goals                                                                                                                                                                                        | Depdendencies | Techstack              | Main Owner                   | Where do they happen? | Examples                                                                                                                                                                                                                                                                                                                                                                                                 |
|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------|------------------------|------------------------------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Unit              | To verify a single unit of code does exactly what it is supposed to do in isolation.                                                                                                         | Mocked        | Jest & Vue Test Utils  | Developer                    | Component             | When I call a method, does it call the necessary dependencies with the correct parameters? <br/><br/> When I call a computed property, does it return the expected value under different conditions? <br/><br/> When I mount a component, does an element have the expected attributes?                                                                                                                  |
| Component         | To ensure our various components work as expected. We care about how they work, not how they look.  In other words, these are tests that simulate the user using the component in Storybook. | Mocked        | WebDriverIO            | Developer & Quality Engineer | Storybook             | When I use checkout, if I press on the “Go to payment” button and it’s a duplicate order, is the dialog warning the user shown? <br/><br/> When I click ‘Accept All’, is the correct cookie value set? <br/><br/> Clarification: at this level, we care that the dialog warning is displayed. We don’t care that a method sets a property with a specific value, or that the dialog has certain colours. |
| Accessibility     | Ensure that our components are usable to those using assistive technologies whilst adhering to the Web Content Accessibility Guidelines (WCAG) AA standard.                                  | Mocked        | Axe Core & WebDriverIO | Developer & Quality Engineer | Storybook             | Is the contrast between the color and background-color attributes accessible? <br/><br/> Are the ARIA attributes present, with valid values?                                                                                                                                                                                                                                                             |
| Visual Regression | To ensure our components look the way they are supposed to in supported browsers/viewports.                                                                                                  | Mocked        | Percy & WebDriverIO    | Developer & Quality Engineer | Storybook             | Does my component look exactly as expected in multiple screen sizes? <br/><br/> Are the colours, paddings, margins, copies, under different conditions, correct?                                                                                                                                                                                                                                         |