Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ Your Markdown workspace for real projects, docs, and personal knowledge bases, b
[![Windows](https://img.shields.io/github/actions/workflow/status/scabir/NoteBranch/windows-installer.yml?branch=main&label=Windows)](https://github.com/scabir/notebranch/actions/workflows/windows-installer.yml)
[![Linux](https://img.shields.io/github/actions/workflow/status/scabir/NoteBranch/linux-packages.yml?branch=main&label=Linux)](https://github.com/scabir/notebranch/actions/workflows/linux-packages.yml)

**Version**: 2.8.5
Official website: [notebranch.app](https://notebranch.app)

**Version**: 2.9.1
**License**: MIT

## Built for daily note workflows
Expand Down Expand Up @@ -68,6 +70,7 @@ All releases: [github.com/scabir/notebranch/releases](https://github.com/scabir/

## Website

Live website: [notebranch.app](https://notebranch.app)
Static product website source:
[app/website/README.md](app/website/README.md)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
DEFAULT_PAT,
DEFAULT_REMOTE_URL,
apiCreateProfile,
apiGetActiveProfileId,
apiGetFullConfig,
apiGetProfiles,
apiSetActiveProfile,
Expand Down Expand Up @@ -47,30 +46,6 @@ const readProfilesFromDisk = async (userDataDir: string): Promise<any[]> => {
return JSON.parse(content);
};

test("(git) connect to git repo (happy path)", async ({
request: _request,
}, testInfo) => {
const userDataDir = await createIsolatedUserDataDir(testInfo);
let app: ElectronApplication | null = null;

try {
const launched = await launchIntegrationApp(userDataDir);
app = launched.app;
const page = launched.page;

await connectGitRepo(page);

const repoInfo = await getRepoInfo(page);
expect(repoInfo.provider).toBe("git");
expect(
path.resolve(repoInfo.localPath).startsWith(path.resolve(userDataDir)),
).toBe(true);
} finally {
await closeAppIfOpen(app);
await cleanupUserDataDir(userDataDir);
}
});

test("(git) connect using non-default branch", async ({
request: _request,
}, testInfo) => {
Expand Down Expand Up @@ -160,54 +135,6 @@ test("(git) invalid URL connect shows error and stays on setup", async ({
}
});

test("(git) active profile id persists across restart", async ({
request: _request,
}, testInfo) => {
const userDataDir = await createIsolatedUserDataDir(testInfo);
let firstApp: ElectronApplication | null = null;
let secondApp: ElectronApplication | null = null;
try {
const firstLaunch = await launchIntegrationApp(userDataDir);
firstApp = firstLaunch.app;
const firstPage = firstLaunch.page;
await connectGitRepo(firstPage);

const firstRepoInfo = await getRepoInfo(firstPage);
const profile = await apiCreateProfile(firstPage, "Profile Switch B", {
provider: "git",
remoteUrl: "https://github.com/mock/profile-switch-b.git",
branch: "main",
pat: "token-switch-b",
authMethod: "pat",
});
await apiSetActiveProfile(firstPage, profile.id);

await closeAppIfOpen(firstApp);
firstApp = null;

const secondLaunch = await launchIntegrationApp(userDataDir);
secondApp = secondLaunch.app;
const secondPage = secondLaunch.page;

await expect(
secondPage.getByTestId("status-bar-commit-push-action"),
).toBeVisible();
await expect(
secondPage.getByRole("button", { name: "Connect to Repository" }),
).toHaveCount(0);

const activeProfileId = await apiGetActiveProfileId(secondPage);
expect(activeProfileId).toBe(profile.id);

const secondRepoInfo = await getRepoInfo(secondPage);
expect(secondRepoInfo.localPath).not.toBe(firstRepoInfo.localPath);
} finally {
await closeAppIfOpen(firstApp);
await closeAppIfOpen(secondApp);
await cleanupUserDataDir(userDataDir);
}
});

test("(git) invalid active profile id still allows workspace to load", async ({
request: _request,
}, testInfo) => {
Expand Down Expand Up @@ -286,35 +213,6 @@ test("(git) empty remote branch bootstrap succeeds", async ({
}
});

test("(git) re-open app with existing repo skips setup", async ({
request: _request,
}, testInfo) => {
const userDataDir = await createIsolatedUserDataDir(testInfo);
let firstApp: ElectronApplication | null = null;
let secondApp: ElectronApplication | null = null;
try {
const firstLaunch = await launchIntegrationApp(userDataDir);
firstApp = firstLaunch.app;
await connectGitRepo(firstLaunch.page);
await closeAppIfOpen(firstApp);
firstApp = null;

const secondLaunch = await launchIntegrationApp(userDataDir);
secondApp = secondLaunch.app;

await expect(
secondLaunch.page.getByRole("button", { name: "Connect to Repository" }),
).toHaveCount(0);
await expect(
secondLaunch.page.getByTestId("status-bar-commit-push-action"),
).toBeVisible();
} finally {
await closeAppIfOpen(firstApp);
await closeAppIfOpen(secondApp);
await cleanupUserDataDir(userDataDir);
}
});

test("(git) provider lock rejects switching from git to local", async ({
request: _request,
}, testInfo) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ test("(git) create file, edit content, commit and push", async ({
return status.ahead;
})
.toBe(0);
await expect(page.getByTestId("status-bar-push-action")).toBeDisabled();

const repoInfo = await getRepoInfo(page);
await fs.access(path.join(repoInfo.localPath, "integration-note.md"));
Expand Down Expand Up @@ -177,49 +178,6 @@ test("(git) auto-generated commit message truncates with 'and N more'", async ({
}
});

test("(git) save then commit+push ends in synced status", async ({
request: _request,
}, testInfo) => {
const userDataDir = await createIsolatedUserDataDir(testInfo);
let app: ElectronApplication | null = null;
try {
const launched = await launchIntegrationApp(userDataDir);
app = launched.app;
const page = launched.page;
await connectGitRepo(page);

await createMarkdownFile(page, "sync-state.md");
await appendToCurrentEditor(page, "\ncontent\n");
await saveCurrentFile(page);
await commitAndPushAll(page);

const status = await getRepoStatus(page);
expect(status.ahead).toBe(0);
expect(status.hasUncommitted).toBe(false);
} finally {
await closeAppIfOpen(app);
await cleanupUserDataDir(userDataDir);
}
});

test("(git) push button is disabled when no pending commits", async ({
request: _request,
}, testInfo) => {
const userDataDir = await createIsolatedUserDataDir(testInfo);
let app: ElectronApplication | null = null;
try {
const launched = await launchIntegrationApp(userDataDir);
app = launched.app;
const page = launched.page;
await connectGitRepo(page);

await expect(page.getByTestId("status-bar-push-action")).toBeDisabled();
} finally {
await closeAppIfOpen(app);
await cleanupUserDataDir(userDataDir);
}
});

test("(git) push button enables after commit and disables after push", async ({
request: _request,
}, testInfo) => {
Expand Down Expand Up @@ -262,6 +220,7 @@ test("(git) pull button enabled when behind and disabled after pull", async ({
await connectGitRepo(page);

await expect(page.getByTestId("status-bar-pull-action")).toBeEnabled();
await expect(page.getByTestId("status-bar-push-action")).toBeDisabled();
await clickPull(page);
await expectSavedStatus(page);
await expect(page.getByTestId("status-bar-pull-action")).toBeDisabled();
Expand Down Expand Up @@ -506,27 +465,6 @@ test("(git) commit failure is surfaced and app stays responsive", async ({
}
});

test("(git) push remains disabled when repo is only behind", async ({
request: _request,
}, testInfo) => {
const userDataDir = await createIsolatedUserDataDir(testInfo);
let app: ElectronApplication | null = null;
try {
const launched = await launchIntegrationApp(userDataDir, {
env: { NOTEBRANCH_MOCK_GIT_INITIAL_BEHIND: "2" },
});
app = launched.app;
const page = launched.page;
await connectGitRepo(page);

await expect(page.getByTestId("status-bar-pull-action")).toBeEnabled();
await expect(page.getByTestId("status-bar-push-action")).toBeDisabled();
} finally {
await closeAppIfOpen(app);
await cleanupUserDataDir(userDataDir);
}
});

test("(git) git unavailable warning is shown for existing git config", async ({
request: _request,
}, testInfo) => {
Expand Down
49 changes: 0 additions & 49 deletions app/desktop/integration-tests/s3/app-lifecycle.integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,55 +71,6 @@ test("(S3) restart app and recover s3 workspace", async ({
}
});

test("(S3) parallel app instances stay isolated by userData path", async ({
request: _request,
}) => {
const userDataDirA = await fs.mkdtemp(
path.join(os.tmpdir(), `NoteBranch-s3-isolation-a-${Date.now()}-`),
);
const userDataDirB = await fs.mkdtemp(
path.join(os.tmpdir(), `NoteBranch-s3-isolation-b-${Date.now()}-`),
);

let appA: ElectronApplication | null = null;
let appB: ElectronApplication | null = null;

try {
const launchA = await launchS3IntegrationApp(userDataDirA);
appA = launchA.app;
const pageA = launchA.page;
await connectS3Repo(pageA, { bucket: "s3-isolation-a" });
await createMarkdownFile(pageA, "only-a.md");

const launchB = await launchS3IntegrationApp(userDataDirB);
appB = launchB.app;
const pageB = launchB.page;
await connectS3Repo(pageB, { bucket: "s3-isolation-b" });
await createMarkdownFile(pageB, "only-b.md");

const repoInfoA = await getRepoInfo(pageA);
const repoInfoB = await getRepoInfo(pageB);
expect(
path.resolve(repoInfoA.localPath).startsWith(path.resolve(userDataDirA)),
).toBe(true);
expect(
path.resolve(repoInfoB.localPath).startsWith(path.resolve(userDataDirB)),
).toBe(true);

const pathsA = flattenTreePaths(await listTree(pageA));
const pathsB = flattenTreePaths(await listTree(pageB));
expect(pathsA).toContain("only-a.md");
expect(pathsA).not.toContain("only-b.md");
expect(pathsB).toContain("only-b.md");
expect(pathsB).not.toContain("only-a.md");
} finally {
await closeAppIfOpen(appA);
await closeAppIfOpen(appB);
await cleanupUserDataDir(userDataDirA);
await cleanupUserDataDir(userDataDirB);
}
});

test("(S3) restart preserves unsynced local changes", async ({
request: _request,
}, testInfo) => {
Expand Down
Loading
Loading