mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-27 00:12:57 -05:00
25 lines
636 B
JavaScript
25 lines
636 B
JavaScript
const test = require('tap').test;
|
|
const UserData = require('../../src/io/userData');
|
|
|
|
test('spec', t => {
|
|
const userData = new UserData();
|
|
|
|
t.type(userData, 'object');
|
|
t.type(userData.postData, 'function');
|
|
t.type(userData.getUsername, 'function');
|
|
t.end();
|
|
});
|
|
|
|
test('getUsername returns empty string initially', t => {
|
|
const userData = new UserData();
|
|
|
|
t.strictEquals(userData.getUsername(), '');
|
|
t.end();
|
|
});
|
|
|
|
test('postData sets the username', t => {
|
|
const userData = new UserData();
|
|
userData.postData({username: 'TEST'});
|
|
t.strictEquals(userData.getUsername(), 'TEST');
|
|
t.end();
|
|
});
|