Add: requestTodayBestRecord, updateTodayBestRecord
This commit is contained in:
@@ -131,11 +131,12 @@ QUnit.test( "HowToPlay", function( assert ) {
|
||||
let howToPlayForSpaceInvaders = "외계인이 나타났다!\\n마우스 왼쪽 버튼으로\\n외계인을 클릭해서 물리쳐 주세요.";
|
||||
|
||||
let done = assert.async(2);
|
||||
|
||||
setTimeout(function() {
|
||||
dbConnectManager.requestHowToPlay(
|
||||
101, // space_invaders app ID
|
||||
(jsonData) => {
|
||||
howToPlay = jsonData["HowToPlay"];
|
||||
let howToPlay = jsonData["HowToPlay"];
|
||||
assert.equal(howToPlay, howToPlayForSpaceInvaders);
|
||||
done();
|
||||
},
|
||||
@@ -148,7 +149,7 @@ QUnit.test( "HowToPlay", function( assert ) {
|
||||
dbConnectManager.requestHowToPlay(
|
||||
1, // korean basic typing
|
||||
(jsonData) => {
|
||||
howToPlay = jsonData["HowToPlay"];
|
||||
let howToPlay = jsonData["HowToPlay"];
|
||||
assert.equal(howToPlay, "");
|
||||
done();
|
||||
},
|
||||
@@ -160,3 +161,50 @@ QUnit.test( "HowToPlay", function( assert ) {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
QUnit.test( "UpdateRecord", function( assert ) {
|
||||
let todayBestRecord = 0;
|
||||
|
||||
let done = assert.async();
|
||||
|
||||
setTimeout(function() {
|
||||
dbConnectManager.requestTodayBestRecord(
|
||||
1, // maestro ID for "jisangs"
|
||||
1, // user ID for jisangs
|
||||
101, // space_invaders app ID
|
||||
(jsonData) => {
|
||||
todayBestRecord = jsonData["BestRecord"];
|
||||
},
|
||||
(jsonData) => {
|
||||
console.log(jsonData);
|
||||
todayBestRecord = 0;
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
dbConnectManager.updateTodayBestRecord(
|
||||
1, // maestro ID for "jisangs"
|
||||
1, // user ID for jisangs
|
||||
101, // space_invaders app ID
|
||||
todayBestRecord + 1000 // new record
|
||||
);
|
||||
}, 100);
|
||||
|
||||
setTimeout(function() {
|
||||
dbConnectManager.requestTodayBestRecord(
|
||||
1, // maestro ID for "jisangs"
|
||||
1, // user ID for jisangs
|
||||
101, // space_invaders app ID
|
||||
(jsonData) => {
|
||||
let bestRecord = jsonData["BestRecord"];
|
||||
assert.equal(bestRecord, todayBestRecord + 1000);
|
||||
done();
|
||||
},
|
||||
(jsonData) => {
|
||||
console.log(jsonData);
|
||||
done();
|
||||
}
|
||||
);
|
||||
}, 200);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user