Skip to content
Snippets Groups Projects
Unverified Commit 339dfe0b authored by Benjamin Wheeler's avatar Benjamin Wheeler Committed by GitHub
Browse files

Merge pull request #4846 from paulkaplan/update-builtin-assets

Update the built-in SVG assets for the default project
parents 34a9a972 eb74d6c0
No related branches found
No related tags found
No related merge requests found
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -4,8 +4,8 @@ import projectData from './project-data'; ...@@ -4,8 +4,8 @@ import projectData from './project-data';
import popWav from '!arraybuffer-loader!./83a9787d4cb6f3b7632b4ddfebf74367.wav'; import popWav from '!arraybuffer-loader!./83a9787d4cb6f3b7632b4ddfebf74367.wav';
import meowWav from '!arraybuffer-loader!./83c36d806dc92327b9e7049a565c6bff.wav'; import meowWav from '!arraybuffer-loader!./83c36d806dc92327b9e7049a565c6bff.wav';
import backdrop from '!raw-loader!./cd21514d0531fdffb22204e0ec5ed84a.svg'; import backdrop from '!raw-loader!./cd21514d0531fdffb22204e0ec5ed84a.svg';
import costume1 from '!raw-loader!./09dc888b0b7df19f70d81588ae73420e.svg'; import costume1 from '!raw-loader!./b7853f557e4426412e64bb3da6531a99.svg';
import costume2 from '!raw-loader!./3696356a03a8d938318876a593572843.svg'; import costume2 from '!raw-loader!./e6ddc55a6ddd9cc9d84fe0b4c21e016f.svg';
/* eslint-enable import/no-unresolved */ /* eslint-enable import/no-unresolved */
const defaultProject = translator => { const defaultProject = translator => {
...@@ -40,12 +40,12 @@ const defaultProject = translator => { ...@@ -40,12 +40,12 @@ const defaultProject = translator => {
dataFormat: 'SVG', dataFormat: 'SVG',
data: encoder.encode(backdrop) data: encoder.encode(backdrop)
}, { }, {
id: '09dc888b0b7df19f70d81588ae73420e', id: 'b7853f557e4426412e64bb3da6531a99',
assetType: 'ImageVector', assetType: 'ImageVector',
dataFormat: 'SVG', dataFormat: 'SVG',
data: encoder.encode(costume1) data: encoder.encode(costume1)
}, { }, {
id: '3696356a03a8d938318876a593572843', id: 'e6ddc55a6ddd9cc9d84fe0b4c21e016f',
assetType: 'ImageVector', assetType: 'ImageVector',
dataFormat: 'SVG', dataFormat: 'SVG',
data: encoder.encode(costume2) data: encoder.encode(costume2)
......
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