Skip to content

Commit 7b4b35d

Browse files
author
Simeon Kummer
committed
Add waits after put operations and test take functionality
1 parent 6e3b0b2 commit 7b4b35d

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

test/externalTests/cartographyTable.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,31 @@ module.exports = () => async (bot) => {
4141

4242
// Put map in slot 0
4343
await cartographyTable.putMap(mapId, null, 1)
44+
await bot.test.wait(200)
4445
assert.strictEqual(cartographyTable.mapItem().type, mapId)
4546
assert.strictEqual(cartographyTable.mapItem().count, 1)
4647

4748
// Put paper in slot 1 (modifier)
4849
await cartographyTable.putModifier(paperId, null, 1)
50+
await bot.test.wait(200)
4951
assert.strictEqual(cartographyTable.modifierItem().type, paperId)
5052
assert.strictEqual(cartographyTable.modifierItem().count, 1)
5153

54+
// Wait for the items to settle in the window
55+
await bot.test.wait(500)
56+
57+
// Take items back
58+
await cartographyTable.takeModifier()
59+
await cartographyTable.takeMap()
60+
assert.strictEqual(cartographyTable.mapItem(), null)
61+
assert.strictEqual(cartographyTable.modifierItem(), null)
62+
5263
cartographyTable.close()
64+
await bot.test.wait(500)
65+
66+
// Check inventory - items should be back
67+
const mapCount = bot.inventory.count(mapId)
68+
const paperCount = bot.inventory.count(paperId)
69+
assert.strictEqual(mapCount, 1)
70+
assert.strictEqual(paperCount, 1)
5371
}

0 commit comments

Comments
 (0)