| 38 | * each test title is unique. |
| 39 | */ |
| 40 | const generateTitle = (title: string, config: TestConfig): string => { |
| 41 | const { mode, direction, palette } = config; |
| 42 | |
| 43 | if (palette === 'light') { |
| 44 | /** |
| 45 | * Ionic has many existing tests that existed prior to |
| 46 | * the introduction of palette testing. To maintain backwards |
| 47 | * compatibility, we will not include the palette in the test |
| 48 | * title if the palette is set to light. |
| 49 | */ |
| 50 | return `${title} - ${mode}/${direction}`; |
| 51 | } |
| 52 | |
| 53 | return `${title} - ${mode}/${direction}/${palette}`; |
| 54 | }; |
| 55 | |
| 56 | /** |
| 57 | * Generates a unique filename based on a base filename |