forked from Thaewyn/operation-jungle-knight
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Thaewyn#24 from DevelopThisOfficial/issue_17-skill…
…_data_structure added new data structure for 'software' items, added better logic for…
- Loading branch information
Showing
6 changed files
with
176 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const DBController = require("../../controllers/db_controller.js"); | ||
const software_ref = require("../../db/software_ref.json"); | ||
|
||
describe("DBController", () => { | ||
jest.useFakeTimers(); | ||
let dbc; | ||
beforeEach(() => { | ||
|
||
dbc = new DBController(); //FIXME: need to mock mysql connection or otherwise mock timers. | ||
}) | ||
|
||
it("should construct a new DBController instance when initialized", () => { | ||
const dbcInst = new DBController(); | ||
expect(dbcInst).toBeInstanceOf(DBController); | ||
}); | ||
|
||
describe("getSoftwareDetailsById", () => { | ||
it("should accept an id parameter that is a number", () => { | ||
|
||
}) | ||
|
||
it("should return the details for an item if the id is valid", () => { | ||
let sampleId = 2; | ||
let sampleDetails = software_ref[sampleId]; | ||
|
||
expect(dbc.getSoftwareDetailsById(sampleId)).toEqual(sampleDetails); | ||
}) | ||
|
||
it("should return an error string if the id provided is not in the database", () => { | ||
expect(dbc.getSoftwareDetailsById(99)).toEqual("ERR: No software with that ID"); | ||
}) | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"1": { | ||
"id": 1, | ||
"name": "ICE Pick", | ||
"icon_url": "", | ||
"desc": "Standard ICE pick spell, breaks down enemy ICE.", | ||
"cooldown": 0, | ||
"targets": "FIRST1", | ||
"power": 10, | ||
"effect": "DAMAGE", | ||
"status": [], | ||
"cost": 10 | ||
}, | ||
"2": { | ||
"id": 2, | ||
"name": "Fireball", | ||
"icon_url": "", | ||
"desc": "Hits the first 2 enemies for splash damage, and cause burn.", | ||
"cooldown": 2, | ||
"targets": "FIRST2", | ||
"power": 20, | ||
"effect": "DAMAGE", | ||
"status": [2], | ||
"cost": 10 | ||
}, | ||
"3": { | ||
"id": 3, | ||
"name": "Thumper", | ||
"icon_url": "", | ||
"desc": "Hits all enemies for moderate damage.", | ||
"cooldown": 2, | ||
"targets": "ALL", | ||
"power": 10, | ||
"effect": "DAMAGE", | ||
"status": [], | ||
"cost": 10 | ||
}, | ||
"4": { | ||
"id": 4, | ||
"name": "Heal", | ||
"desc": "Restore a small amount of health", | ||
"cooldown": 4, | ||
"targets": "SELF", | ||
"power": 5, | ||
"effect": "HEAL", | ||
"status": [], | ||
"cost": 10 | ||
}, | ||
"5": { | ||
"id": 5, | ||
"name": "Cleanse", | ||
"desc": "Remove burn and poison status effects.", | ||
"cooldown": 2, | ||
"targets": "SELF", | ||
"power": 0, | ||
"effect": "HEAL", | ||
"status": [2,3], | ||
"cost": 10 | ||
}, | ||
"6": { | ||
"id": 6, | ||
"name": "Firewall", | ||
"desc": "Increase player defense.", | ||
"cooldown": 2, | ||
"targets": "SELF", | ||
"power": 10, | ||
"effect": "DEFEND", | ||
"status": [], | ||
"cost": 10 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters