Skip to content
Snippets Groups Projects
Commit eb74d6c0 authored by Paul Kaplan's avatar Paul Kaplan
Browse files

Include a unit test to ensure default project assets are included

parent a2035a68
No related branches found
No related tags found
No related merge requests found
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);
});
});
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment