Skip to content

Commit 4c2728d

Browse files
committed
style: run Prettier on reflection.js and fix PORT test assertion
- Reformat reflection.js with Prettier to pass lint CI - Update reflection.test.js PORT expectation: dynamic URL resolver returns 'http://localhost:8000' in jsdom (Jest test environment) instead of the old hardcoded AWS IP
1 parent b9f8bba commit 4c2728d

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

js/widgets/__tests__/reflection.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ describe("ReflectionMatrix", () => {
124124
expect(reflection.isOpen).toBe(true);
125125
expect(reflection.isMaximized).toBe(false);
126126
expect(mockActivity.isInputON).toBe(true);
127-
expect(reflection.PORT).toBe("http://3.105.177.138:8000");
127+
expect(reflection.PORT).toBe("http://localhost:8000");
128128

129129
expect(window.widgetWindows.windowFor).toHaveBeenCalledWith(
130130
reflection,

js/widgets/reflection.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ class ReflectionMatrix {
8282
window.location.hostname === "127.0.0.1"
8383
) {
8484
return "http://localhost:8000";
85-
} else if (
86-
window.location.hostname.includes("musicblocks.sugarlabs.org")
87-
) {
85+
} else if (window.location.hostname.includes("musicblocks.sugarlabs.org")) {
8886
return `${window.location.protocol}//api.musicblocks.sugarlabs.org`;
8987
} else {
9088
return `${window.location.protocol}//${window.location.hostname}:8000`;

0 commit comments

Comments
 (0)