mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-11-07 02:55:24 +00:00
chore: tier map for plugins that are not pinned yet
This commit is contained in:
1 parent
950e5398c9
commit
76d41a2cbb
6 files changed
+179
-12
No files matched your search
@@ -10,6 +10,7 @@ import {
|
||||
fetchArtifact,
|
||||
extractArtifact,
|
||||
pinsFromIndex,
|
||||
parsePluginTiers,
|
||||
buildBundledIndex,
|
||||
findLocalPluginBuilds,
|
||||
isLocalBuildStale,
|
||||
@@ -253,6 +254,34 @@ describe("buildBundledIndex", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("parsePluginTiers", () => {
|
||||
it("reads tiers and onboarding", () => {
|
||||
expect(
|
||||
parsePluginTiers({
|
||||
plugins: {
|
||||
a: { tier: "full" },
|
||||
b: { tier: "standard", onboarding: { recommended: true } },
|
||||
},
|
||||
}),
|
||||
).toEqual({
|
||||
tiers: {
|
||||
a: { tier: "full" },
|
||||
b: {
|
||||
tier: "standard",
|
||||
onboarding: { recommended: true, consent: false },
|
||||
},
|
||||
},
|
||||
problems: [],
|
||||
});
|
||||
});
|
||||
|
||||
it("reports a bad tier", () => {
|
||||
expect(
|
||||
parsePluginTiers({ plugins: { a: { tier: "huge" } } }).problems,
|
||||
).toEqual(["a tier must be one of minimal, standard, full"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("pinsFromIndex", () => {
|
||||
const index = {
|
||||
plugins: [
|
||||
@@ -305,6 +334,26 @@ describe("pinsFromIndex", () => {
|
||||
expect(pins[1].tier).toBe("full");
|
||||
});
|
||||
|
||||
it("takes tier and onboarding for a new plugin from the tier map", () => {
|
||||
const defaults = {
|
||||
beta: {
|
||||
tier: "standard",
|
||||
onboarding: { recommended: true, consent: false },
|
||||
},
|
||||
alpha: { tier: "minimal" },
|
||||
};
|
||||
const pins = pinsFromIndex(
|
||||
index,
|
||||
null,
|
||||
[{ id: "alpha", tier: "full" }],
|
||||
null,
|
||||
defaults,
|
||||
);
|
||||
expect(pins[0].tier).toBe("full");
|
||||
expect(pins[1].tier).toBe("standard");
|
||||
expect(pins[1].onboarding).toEqual({ recommended: true, consent: false });
|
||||
});
|
||||
|
||||
it("skips releases whose engine.termix excludes the core version", () => {
|
||||
const withEngine = {
|
||||
plugins: [
|
||||
|
||||
Reference in new issue
Block a user