Update /give test
This commit is contained in:
@@ -130,10 +130,12 @@ Deno.test("/give suggests item ids as they're typed", async () => {
|
|||||||
// just the ids
|
// just the ids
|
||||||
assertEquals(carrots.suggestions, [{ text: "bworld:carrot" }]);
|
assertEquals(carrots.suggestions, [{ text: "bworld:carrot" }]);
|
||||||
|
|
||||||
// every item, but not air
|
// items from every mod, but not air. the server sends at most 100, so these look past the first ones
|
||||||
const all = suggest("/give ").suggestions.map((s: { text: string }) => s.text);
|
const ids = (text: string) => suggest(text).suggestions.map((s: { text: string }) => s.text);
|
||||||
assert(all.includes("bworld:stone") && all.includes("farmersdelight:cabbage"), String(all));
|
assertEquals(ids("/give ").length, 100);
|
||||||
assert(!all.includes("bworld:air"));
|
assert(ids("/give bworld:sto").includes("bworld:stone"));
|
||||||
|
assert(ids("/give farmersdelight:cab").includes("farmersdelight:cabbage"));
|
||||||
|
assert(!ids("/give bworld:a").includes("bworld:air"));
|
||||||
assertEquals(suggest("/give farmersdelight:tom").suggestions.map((s: { text: string }) => s.text), [
|
assertEquals(suggest("/give farmersdelight:tom").suggestions.map((s: { text: string }) => s.text), [
|
||||||
"farmersdelight:tomato",
|
"farmersdelight:tomato",
|
||||||
"farmersdelight:tomato_sauce",
|
"farmersdelight:tomato_sauce",
|
||||||
|
|||||||
Reference in New Issue
Block a user