refactor(mobile): keep project selection helper private (#9999)
This commit is contained in:
1 parent
ac93fbfad0
commit
1e24b43d3f
2 files changed
+1
-14
No files matched your search
@@ -4,7 +4,6 @@ import { describe, expect, it } from "vite-plus/test";
|
||||
import type { EnvironmentProject } from "@t3tools/client-runtime/state/shell";
|
||||
import type { HomeProjectScope } from "../home/homeThreadList";
|
||||
import {
|
||||
getOnlySelectableProject,
|
||||
getProjectScopeSelectionTarget,
|
||||
resolveDraftProjectSelection,
|
||||
} from "./new-task-project-selection";
|
||||
@@ -36,18 +35,6 @@ function makeScope(projects: ReadonlyArray<EnvironmentProject>): HomeProjectScop
|
||||
};
|
||||
}
|
||||
|
||||
describe("getOnlySelectableProject", () => {
|
||||
it("auto-selects when there is exactly one physical project", () => {
|
||||
const project = makeProject("t3code");
|
||||
expect(getOnlySelectableProject([makeScope([project])])).toBe(project);
|
||||
});
|
||||
|
||||
it("selects the representative when one logical project has multiple workspaces", () => {
|
||||
const projects = [makeProject("t3code"), makeProject("t3code-2"), makeProject("t3code-3")];
|
||||
expect(getOnlySelectableProject([makeScope(projects)])).toBe(projects[0]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("getProjectScopeSelectionTarget", () => {
|
||||
it("keeps the current environment when it hosts the selected logical project", () => {
|
||||
const projects = [makeProject("t3code-mac", "mac"), makeProject("t3code-server", "server")];
|
||||
|
||||
@@ -19,7 +19,7 @@ export function getProjectScopeSelectionTarget(
|
||||
);
|
||||
}
|
||||
|
||||
export function getOnlySelectableProject(
|
||||
function getOnlySelectableProject(
|
||||
projectScopes: ReadonlyArray<HomeProjectScope>,
|
||||
): EnvironmentProject | null {
|
||||
const onlyScope = projectScopes.length === 1 ? projectScopes[0] : null;
|
||||
|
||||
Reference in new issue
Block a user