Skip to content

Commit 2ab2177

Browse files
committed
Make the local scratch test work again
This moves the assets around to where they are expected.
1 parent 26d1983 commit 2ab2177

5 files changed

Lines changed: 8 additions & 4 deletions

File tree

cypress/e2e/spec-scratch.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const getIframeBody = () => {
2121
describe("Scratch", () => {
2222
beforeEach(() => {
2323
cy.visit(origin);
24-
cy.findByText("blank-scratch").click();
24+
cy.findByText("cool-scratch").click();
2525
});
2626

2727
it("loads Scratch in an iframe", () => {

public/api/assets/internalapi/asset/8a9dadf4eea61892ec6908b1c99e4961.svg/get renamed to public/api/scratch/assets/internalapi/asset/8a9dadf4eea61892ec6908b1c99e4961.svg/get

File renamed without changes.
File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"identifier": "blank-scratch",
2+
"identifier": "cool-scratch.json",
33
"project_type": "code_editor_scratch",
44
"locale": "en",
5-
"name": "Blank Scratch Project",
5+
"name": "Sample Scratch Project",
66
"user_id": null,
77
"instructions": {
88
"content": "instructions go here",

src/web-component.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<a href="#" data-project="blank-python-starter">blank-python-starter</a>
6161
<a href="#" data-project="cool-python">cool-python</a>
6262
<a href="#" data-project="python-plotly">python-plotly</a>
63-
<a href="#" data-project="blank-scratch">blank-scratch</a>
63+
<a href="#" data-project="cool-scratch">cool-scratch</a>
6464
</div>
6565
<div id="editor-component"></div>
6666
<p id="results"></p>
@@ -114,6 +114,10 @@
114114
newWebComp.setAttribute("code", "");
115115
newWebComp.setAttribute("class", "editor-wc");
116116
newWebComp.setAttribute("host_styles", JSON.stringify([]));
117+
const scratchApiEndpoint = new URL(".", window.location.href)
118+
.href
119+
.replace(/\/$/, "");
120+
newWebComp.setAttribute("scratch_api_endpoint", scratchApiEndpoint);
117121

118122
queryParams.forEach((value, key) => {
119123
newWebComp.setAttribute(key, value);

0 commit comments

Comments
 (0)