Skip to content
Snippets Groups Projects
Verified Commit dc9252dd authored by Loïs Poujade's avatar Loïs Poujade
Browse files

Different local link

parent 2fb2ba76
Branches
No related tags found
No related merge requests found
Pipeline #1186 passed
<!doctype html>
<html>
<head><title>hello</title></head
<body><p>text <a href="https://example.org/">and a link</a></p></body>
</html>
...@@ -15,20 +15,20 @@ describe('Open example', () => { ...@@ -15,20 +15,20 @@ describe('Open example', () => {
describe('Open local HTTP server', () => { describe('Open local HTTP server', () => {
beforeAll(async () => { beforeAll(async () => {
let response = await page.goto('http://127.0.0.1:4488'); let response = await page.goto('http://127.0.0.1:4488/__tests__/index.html');
expect(response.status()).toBe(200); expect(response.status()).toBe(200);
}); });
it('has the correct page title', async () => { it('has the correct page title', async () => {
const title = await page.title(); const title = await page.title();
expect(title).toBe('Index of /'); expect(title).toBe('hello');
}); });
it('has the correct link', async () => { it('has the correct link', async () => {
await page.waitForSelector('a[href="./jest.json"]'); await page.waitForSelector('a[href="https://example.org/"]');
await expect(page).toMatchElement('a[href="./jest.json"]'); await expect(page).toMatchElement('a[href="https://example.org/"]');
}); });
}); });
describe('Open example', () => { describe('Open example bis', () => {
beforeAll(async () => { beforeAll(async () => {
let response = await page.goto('https://example.org'); let response = await page.goto('https://example.org');
expect(response.status()).toBe(200); expect(response.status()).toBe(200);
...@@ -43,17 +43,17 @@ describe('Open example', () => { ...@@ -43,17 +43,17 @@ describe('Open example', () => {
}); });
}); });
describe('Open local HTTP server', () => { describe('Open local HTTP server bis', () => {
beforeAll(async () => { beforeAll(async () => {
let response = await page.goto('http://127.0.0.1:4488'); let response = await page.goto('http://127.0.0.1:4488/__tests__/index.html');
expect(response.status()).toBe(200); expect(response.status()).toBe(200);
}); });
it('has the correct page title', async () => { it('has the correct page title', async () => {
const title = await page.title(); const title = await page.title();
expect(title).toBe('Index of /'); expect(title).toBe('hello');
}); });
it('has the correct link', async () => { it('has the correct link', async () => {
await page.waitForSelector('a[href="./jest.json"]'); await page.waitForSelector('a[href="https://example.org/"]');
await expect(page).toMatchElement('a[href="./jest.json"]'); await expect(page).toMatchElement('a[href="https://example.org/"]');
}); });
}); });
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment