mirror of
https://github.com/scratchfoundation/scratch-html5.git
synced 2024-11-28 10:05:55 -05:00
Merge from upstream
This commit is contained in:
commit
aade0b4121
3 changed files with 10 additions and 4 deletions
|
@ -245,7 +245,7 @@ SensingPrims.prototype.primTimestamp = function(b) {
|
|||
var epoch = new Date(2000, 0, 1);
|
||||
var dst = now.getTimezoneOffset() - epoch.getTimezoneOffset();
|
||||
var msSince = now.getTime() - epoch.getTime();
|
||||
msSince += (now.getTimezoneOffset() - dst) * 60000;
|
||||
msSince -= dst * 60000;
|
||||
return msSince / 86400000;
|
||||
};
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ describe('SensingPrims', function() {
|
|||
});
|
||||
|
||||
it('should return the days since 2000', function() {
|
||||
expect(sensingPrims.prototype.primTimestamp()).toEqual(5280.25);
|
||||
expect(sensingPrims.prototype.primTimestamp()).toBeCloseTo(5280);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -169,7 +169,10 @@ describe('Sprite', function() {
|
|||
expect($('.ask-container').css('bottom')).toBe('7px');
|
||||
expect($('.ask-container').css('height')).toBe('25px');
|
||||
expect($('.ask-container').css('height')).toBe('25px');
|
||||
expect($('.ask-text-field').is(':focus')).toBe(true);
|
||||
expect(
|
||||
$('.ask-text-field').is(':focus') ||
|
||||
document.activeElement.className.match(/ask-text-field/) !== null
|
||||
).toBe(true);
|
||||
expect(spriteProto.askInputOn).toBe(true);
|
||||
});
|
||||
|
||||
|
@ -177,7 +180,10 @@ describe('Sprite', function() {
|
|||
spriteProto.visible = false;
|
||||
spriteProto.showAsk();
|
||||
expect($('.ask-container').css('display')).toBe('none');
|
||||
expect($('.ask-text-field').is(':focus')).toBe(false);
|
||||
expect(
|
||||
$('.ask-text-field').is(':focus') ||
|
||||
document.activeElement.className.match(/ask-text-field/) !== null
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue