Initial commit of 001code-html Scratch frontend project.
Includes scratch-gui, scratch-vm, scratch-blocks, scratch-render, scratch-l10n, and deployment config. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
21
scratch-gui/test/unit/util/default-project.test.js
Normal file
21
scratch-gui/test/unit/util/default-project.test.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import defaultProjectGenerator from '../../../src/lib/default-project/index.js';
|
||||
|
||||
describe('defaultProject', () => {
|
||||
// This test ensures that the assets referenced in the default project JSON
|
||||
// do not get out of sync with the raw assets that are included alongside.
|
||||
// see https://github.com/LLK/scratch-gui/issues/4844
|
||||
test('assets referenced by the project are included', () => {
|
||||
const translatorFn = () => '';
|
||||
const defaultProject = defaultProjectGenerator(translatorFn);
|
||||
const includedAssetIds = defaultProject.map(obj => obj.id);
|
||||
const projectData = JSON.parse(defaultProject[0].data);
|
||||
projectData.targets.forEach(target => {
|
||||
target.costumes.forEach(costume => {
|
||||
expect(includedAssetIds.includes(costume.assetId)).toBe(true);
|
||||
});
|
||||
target.sounds.forEach(sound => {
|
||||
expect(includedAssetIds.includes(sound.assetId)).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user