mirror of
https://gitlab.com/Oreolek/salet-module.git
synced 2024-07-01 06:15:04 +03:00
Fixed taking units, qUnit tests
This commit is contained in:
parent
8c9eeef6bd
commit
748b9c0e4d
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "salet",
|
"name": "salet",
|
||||||
"version": "1.6.2",
|
"version": "1.6.3",
|
||||||
"description": "A general client-side framework for cybertext interactive fiction games.",
|
"description": "A general client-side framework for cybertext interactive fiction games.",
|
||||||
"keywords": ["ifiction", "interactive fiction", "games", "coffee-script", "text", "menu"],
|
"keywords": ["ifiction", "interactive fiction", "games", "coffee-script", "text", "menu"],
|
||||||
"homepage": "http://salet.oreolek.ru",
|
"homepage": "http://salet.oreolek.ru",
|
||||||
|
|
|
@ -2,7 +2,7 @@ class SaletRoom
|
||||||
constructor: (spec) ->
|
constructor: (spec) ->
|
||||||
@visited = 0
|
@visited = 0
|
||||||
@title = "Room"
|
@title = "Room"
|
||||||
@units = {}
|
@units = []
|
||||||
@canView = true
|
@canView = true
|
||||||
@canChoose = true
|
@canChoose = true
|
||||||
@priority = 1
|
@priority = 1
|
||||||
|
|
|
@ -50,7 +50,7 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
salet.rooms["start2"].take(lamp);
|
salet.rooms["start2"].take(lamp);
|
||||||
assert.equal(lamp.location, "start2", "The lamp unit is in 'start2' room");
|
assert.equal(lamp.location, "start2", "The lamp unit is in 'start2' room");
|
||||||
salet.rooms["start2"].drop("");
|
salet.rooms["start2"].drop("lamp");
|
||||||
assert.equal(lamp.location, undefined, "The lamp unit is nowhere");
|
assert.equal(lamp.location, undefined, "The lamp unit is nowhere");
|
||||||
});
|
});
|
||||||
QUnit.test("Localization", function(assert) {
|
QUnit.test("Localization", function(assert) {
|
||||||
|
@ -63,7 +63,7 @@ $(document).ready(function() {
|
||||||
QUnit.test("View", function(assert) {
|
QUnit.test("View", function(assert) {
|
||||||
salet.view.clearContent();
|
salet.view.clearContent();
|
||||||
assert.equal(jQuery("#content").html(), "", "View clears the content");
|
assert.equal(jQuery("#content").html(), "", "View clears the content");
|
||||||
salet.view.write("<p>hello</p>");
|
salet.view.append("<p>hello</p>");
|
||||||
return assert.equal(jQuery("#content").html(), "<p>hello</p>", "View writes new content");
|
return assert.equal(jQuery("#content").html(), "<p>hello</p>", "View writes new content");
|
||||||
});
|
});
|
||||||
return setTimeout(function() {
|
return setTimeout(function() {
|
||||||
|
|
Loading…
Reference in a new issue