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
|
||||
assertEquals(carrots.suggestions, [{ text: "bworld:carrot" }]);
|
||||
|
||||
// every item, but not air
|
||||
const all = suggest("/give ").suggestions.map((s: { text: string }) => s.text);
|
||||
assert(all.includes("bworld:stone") && all.includes("farmersdelight:cabbage"), String(all));
|
||||
assert(!all.includes("bworld:air"));
|
||||
// items from every mod, but not air. the server sends at most 100, so these look past the first ones
|
||||
const ids = (text: string) => suggest(text).suggestions.map((s: { text: string }) => s.text);
|
||||
assertEquals(ids("/give ").length, 100);
|
||||
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), [
|
||||
"farmersdelight:tomato",
|
||||
"farmersdelight:tomato_sauce",
|
||||
|
||||
Reference in New Issue
Block a user