()
| 24 | }) |
| 25 | |
| 26 | function runTests() { |
| 27 | describe('with .html extension', () => { |
| 28 | it('should work when requesting the page directly', async () => { |
| 29 | const $ = await next.render$( |
| 30 | '/product/shirts_and_tops/mens_ua_playoff_polo_2.0/1327037.html' |
| 31 | ) |
| 32 | expect($('#text').text()).toBe( |
| 33 | 'Param found: shirts_and_tops, mens_ua_playoff_polo_2.0, 1327037.html' |
| 34 | ) |
| 35 | }) |
| 36 | |
| 37 | it('should work using browser', async () => { |
| 38 | const browser = await next.browser( |
| 39 | '/product/shirts_and_tops/mens_ua_playoff_polo_2.0/1327037.html' |
| 40 | ) |
| 41 | expect(await browser.elementByCss('#text').text()).toBe( |
| 42 | 'Param found: shirts_and_tops, mens_ua_playoff_polo_2.0, 1327037.html' |
| 43 | ) |
| 44 | }) |
| 45 | |
| 46 | it('should work when navigating', async () => { |
| 47 | const browser = await next.browser('/html-links') |
| 48 | await browser.elementByCss('#with-html').click() |
| 49 | expect(await browser.waitForElementByCss('#text').text()).toBe( |
| 50 | 'Param found: shirts_and_tops, mens_ua_playoff_polo_2.0, 1327037.html' |
| 51 | ) |
| 52 | }) |
| 53 | }) |
| 54 | |
| 55 | describe('without .html extension', () => { |
| 56 | it('should work when requesting the page directly', async () => { |
| 57 | const $ = await next.render$( |
| 58 | '/product/shirts_and_tops/mens_ua_playoff_polo_2.0/1327037' |
| 59 | ) |
| 60 | expect($('#text').text()).toBe( |
| 61 | 'Param found: shirts_and_tops, mens_ua_playoff_polo_2.0, 1327037' |
| 62 | ) |
| 63 | }) |
| 64 | |
| 65 | it('should work using browser', async () => { |
| 66 | const browser = await next.browser( |
| 67 | '/product/shirts_and_tops/mens_ua_playoff_polo_2.0/1327037' |
| 68 | ) |
| 69 | expect(await browser.elementByCss('#text').text()).toBe( |
| 70 | 'Param found: shirts_and_tops, mens_ua_playoff_polo_2.0, 1327037' |
| 71 | ) |
| 72 | }) |
| 73 | |
| 74 | it('should work when navigating', async () => { |
| 75 | const browser = await next.browser('/html-links') |
| 76 | await browser.elementByCss('#without-html').click() |
| 77 | expect(await browser.waitForElementByCss('#text').text()).toBe( |
| 78 | 'Param found: shirts_and_tops, mens_ua_playoff_polo_2.0, 1327037' |
| 79 | ) |
| 80 | }) |
| 81 | }) |
| 82 | |
| 83 | if ((global as any).isNextDev) { |
no test coverage detected