From 5ae1b8f372666274d9f11156475901604ec49e77 Mon Sep 17 00:00:00 2001 From: Greg Date: Sat, 28 Dec 2024 18:42:02 +0000 Subject: [PATCH] Fix al-kharid gate integration tests (#571) * Fix al-kharid gate integration tests Note: integration tests don't run on PR's from forks as they don't have the AWS secret for the cache download. * Fix dangerous character warning --- .github/workflows/test-with-coverage.yml | 2 ++ .../achievement/LumbridgeBeginnerTasksTest.kt | 21 +++++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-with-coverage.yml b/.github/workflows/test-with-coverage.yml index 25b1fa716..6d8ac5a33 100644 --- a/.github/workflows/test-with-coverage.yml +++ b/.github/workflows/test-with-coverage.yml @@ -5,6 +5,8 @@ on: - 'main' - 'release/**' pull_request: + branches: + - 'main' env: CACHE_VERSION: 1.2.0 jobs: diff --git a/game/src/test/kotlin/world/gregs/voidps/world/activity/achievement/LumbridgeBeginnerTasksTest.kt b/game/src/test/kotlin/world/gregs/voidps/world/activity/achievement/LumbridgeBeginnerTasksTest.kt index 61cbe7dd2..51a21ac98 100644 --- a/game/src/test/kotlin/world/gregs/voidps/world/activity/achievement/LumbridgeBeginnerTasksTest.kt +++ b/game/src/test/kotlin/world/gregs/voidps/world/activity/achievement/LumbridgeBeginnerTasksTest.kt @@ -19,6 +19,7 @@ import world.gregs.voidps.network.login.protocol.visual.update.player.EquipSlot import world.gregs.voidps.type.Tile import world.gregs.voidps.type.setRandom import world.gregs.voidps.world.script.* +import kotlin.test.assertFalse import kotlin.test.assertTrue internal class LumbridgeBeginnerTasksTest : WorldTest() { @@ -528,7 +529,7 @@ internal class LumbridgeBeginnerTasksTest : WorldTest() { } @Test - fun `Capital Protection, What?`() { + fun `Capital Protection, What`() { val player = createPlayer("adventurer", Tile(3228, 3254)) player.levels.set(Skill.Smithing, 7) player.inventory.add("bronze_bar", "bronze_bar", "hammer") @@ -781,8 +782,9 @@ internal class LumbridgeBeginnerTasksTest : WorldTest() { } @Test - fun `Passing Out`() { + fun `Passing Out with money`() { val player = createPlayer("adventurer", Tile(3267, 3227)) + player.inventory.add("coins", 10) val guard = npcs[Tile(3267, 3226)].first { it.id == "border_guard_al_kharid" } player.npcOption(guard, "Talk-to") @@ -794,6 +796,21 @@ internal class LumbridgeBeginnerTasksTest : WorldTest() { assertTrue(player["passing_out_task", false]) } + @Test + fun `Passing Out without money`() { + val player = createPlayer("adventurer", Tile(3267, 3227)) + player.inventory.add("coins", 9) + + val guard = npcs[Tile(3267, 3226)].first { it.id == "border_guard_al_kharid" } + player.npcOption(guard, "Talk-to") + tick() + player.dialogueContinue(2) + player.dialogueOption("line1") + player.dialogueContinue() + + assertFalse(player["passing_out_task", false]) + } + @Test fun `What is This Place`() { val player = createPlayer("adventurer", Tile(3104, 9571))