|
| 1 | +import { compileStringAsync } from 'sass-embedded' |
| 2 | + |
| 3 | +describe('Components', () => { |
| 4 | + describe('importing using index file', () => { |
| 5 | + it('forwards all components', async () => { |
| 6 | + const sass = ` |
| 7 | + @forward "components"; |
| 8 | + ` |
| 9 | + |
| 10 | + const results = compileStringAsync(sass, { |
| 11 | + loadPaths: ['packages'] |
| 12 | + }) |
| 13 | + |
| 14 | + await expect(results).resolves.not.toThrow() |
| 15 | + }) |
| 16 | + }) |
| 17 | + |
| 18 | + describe('importing using legacy paths', () => { |
| 19 | + it('forwards all components', async () => { |
| 20 | + const sass = ` |
| 21 | + @forward "components/action-link/action-link"; |
| 22 | + @forward "components/back-link/back-link"; |
| 23 | + @forward "components/breadcrumb/breadcrumb"; |
| 24 | + @forward "components/button/button"; |
| 25 | + @forward "components/card/card"; |
| 26 | + @forward "components/contents-list/contents-list"; |
| 27 | + @forward "components/date-input/date-input"; |
| 28 | + @forward "components/details/details"; |
| 29 | + @forward "components/do-dont-list/do-dont-list"; |
| 30 | + @forward "components/error-message/error-message"; |
| 31 | + @forward "components/error-summary/error-summary"; |
| 32 | + @forward "components/fieldset/fieldset"; |
| 33 | + @forward "components/footer/footer"; |
| 34 | + @forward "components/header/header"; |
| 35 | + @forward "components/header/header-organisation"; |
| 36 | + @forward "components/header/header-service"; |
| 37 | + @forward "components/header/header-transactional"; |
| 38 | + @forward "components/header/header-white"; |
| 39 | + @forward "components/hero/hero"; |
| 40 | + @forward "components/hint/hint"; |
| 41 | + @forward "components/images/images"; |
| 42 | + @forward "components/input/input"; |
| 43 | + @forward "components/inset-text/inset-text"; |
| 44 | + @forward "components/label/label"; |
| 45 | + @forward "components/pagination/pagination"; |
| 46 | + @forward "components/panel/panel"; |
| 47 | + @forward "components/checkboxes/checkboxes"; |
| 48 | + @forward "components/radios/radios"; |
| 49 | + @forward "components/select/select"; |
| 50 | + @forward "components/skip-link/skip-link"; |
| 51 | + @forward "components/summary-list/summary-list"; |
| 52 | + @forward "components/tables/tables"; |
| 53 | + @forward "components/tag/tag"; |
| 54 | + @forward "components/task-list/task-list"; |
| 55 | + @forward "components/textarea/textarea"; |
| 56 | + @forward "components/warning-callout/warning-callout"; |
| 57 | + @forward "components/character-count/character-count"; |
| 58 | + @forward "components/tabs/tabs"; |
| 59 | + ` |
| 60 | + |
| 61 | + const results = compileStringAsync(sass, { |
| 62 | + loadPaths: ['packages'] |
| 63 | + }) |
| 64 | + |
| 65 | + await expect(results).resolves.not.toThrow() |
| 66 | + }) |
| 67 | + }) |
| 68 | +}) |
0 commit comments