Update heartwood fixture and re-enable tests

Signed-off-by: xphoniex <dj.2dixx@gmail.com>
This commit is contained in:
xphoniex
2023-01-30 14:27:46 +00:00
parent 40ad8c1efb
commit 9fae5ebb33
7 changed files with 216 additions and 108 deletions
+25 -27
View File
@@ -5,16 +5,18 @@ import {
bobRemote,
} from "@tests/support/fixtures.js";
const modifiedFileFixture = `${projectFixtureUrl}/remotes/${bobRemote}/commits/2b32f6fe50090ebdb4cd7441e943330da3e6ff04`;
const modifiedFileFixture = `${projectFixtureUrl}/remotes/${bobRemote}/commits/${
process.env.HEARTWOOD
? "1e0bb83a89b63da815f2fc24e7ae3c5ceb30e0eb"
: "2b32f6fe50090ebdb4cd7441e943330da3e6ff04"
}`;
test("navigation from commit list", async ({ page }) => {
if (process.env.HEARTWOOD) {
test.skip();
}
await page.goto(projectFixtureUrl);
await page.getByTitle("Change peer").click();
await page.locator("text=bob hyyzz9").click();
await page
.locator(process.env.HEARTWOOD ? `text=${bobRemote}` : "text=bob hyyzz9")
.click();
await page.locator('role=button[name="Commit count"]').click();
await page.locator("text=Update readme").click();
@@ -22,10 +24,6 @@ test("navigation from commit list", async ({ page }) => {
});
test("relative timestamps", async ({ page }) => {
if (process.env.HEARTWOOD) {
test.skip();
}
await page.addInitScript(() => {
window.initializeTestStubs = () => {
window.e2eTestStubs.FakeTimers.install({
@@ -37,25 +35,33 @@ test("relative timestamps", async ({ page }) => {
});
await page.goto(modifiedFileFixture);
await expect(
page.locator(".commit header >> text=bob committed 22 hours ago"),
page.locator(
`.commit header >> text=${
process.env.HEARTWOOD
? "Bob Belcher committed now"
: "bob committed 22 hours ago"
}`,
),
).toBeVisible();
});
test("modified file", async ({ page }) => {
if (process.env.HEARTWOOD) {
test.skip();
}
await page.goto(modifiedFileFixture);
// Commit header.
{
const header = page.locator(".commit header");
await expect(header.locator("text=Update readme")).toBeVisible();
await expect(header.locator("text=Verified")).toBeVisible();
await expect(
header.locator("text=2b32f6fe50090ebdb4cd7441e943330da3e6ff04"),
).toBeVisible();
if (!process.env.HEARTWOOD) {
await expect(header.locator("text=Verified")).toBeVisible();
await expect(
header.locator("text=2b32f6fe50090ebdb4cd7441e943330da3e6ff04"),
).toBeVisible();
} else {
await expect(
header.locator("text=1e0bb83a89b63da815f2fc24e7ae3c5ceb30e0eb"),
).toBeVisible();
}
}
// Diff header.
@@ -71,10 +77,6 @@ test("modified file", async ({ page }) => {
});
test("created file", async ({ page }) => {
if (process.env.HEARTWOOD) {
test.skip();
}
await page.goto(
`${projectFixtureUrl}/remotes/${bobRemote}/commits/d6318f7f3d9c15b8ac6dd52267c53220d00f0982`,
);
@@ -85,10 +87,6 @@ test("created file", async ({ page }) => {
});
test("deleted file", async ({ page }) => {
if (process.env.HEARTWOOD) {
test.skip();
}
await page.goto(
`${projectFixtureUrl}/remotes/${bobRemote}/commits/cd13c2d9a8a930d64a82b6134b44d1b872e33662`,
);