|
| 1 | +global._ = jest.fn((str) => str); |
| 2 | +global._THIS_IS_TURTLE_BLOCKS_ = true; |
| 3 | +const { |
| 4 | + createDefaultStack, |
| 5 | + LOGOJA1, |
| 6 | + NUMBERBLOCKDEFAULT, |
| 7 | + DEFAULTPALETTE, |
| 8 | + TITLESTRING |
| 9 | +} = require('../turtledefs'); |
| 10 | + |
| 11 | +global.GUIDEURL = "guide url"; |
| 12 | +global.RUNBUTTON = "RUNBUTTON"; |
| 13 | +global.STOPBUTTON = "STOPBUTTON"; |
| 14 | +global.HELPTURTLEBUTTON = "HELPTURTLEBUTTON"; |
| 15 | +global.LANGUAGEBUTTON = "LANGUAGEBUTTON"; |
| 16 | + |
| 17 | +if (GUIDEURL === "guide url") { |
| 18 | + GUIDEURL = "https://github.com/sugarlabs/turtleblocksjs/tree/master/guide/README.md"; |
| 19 | +} |
| 20 | + |
| 21 | +describe("turtledefs.js", () => { |
| 22 | + test("LOGOJA1 should be properly initialized", () => { |
| 23 | + expect(LOGOJA1).toBeDefined(); |
| 24 | + expect(typeof LOGOJA1).toBe("string"); |
| 25 | + }); |
| 26 | + |
| 27 | + test("NUMBERBLOCKDEFAULT should be initialized correctly", () => { |
| 28 | + expect(NUMBERBLOCKDEFAULT).toBeDefined(); |
| 29 | + expect(NUMBERBLOCKDEFAULT).toBe(100); |
| 30 | + }); |
| 31 | + |
| 32 | + test("DEFAULTPALETTE should have correct value", () => { |
| 33 | + expect(DEFAULTPALETTE).toBe("turtle"); |
| 34 | + }); |
| 35 | + |
| 36 | + test("GUIDEURL should default to the correct URL", () => { |
| 37 | + expect(GUIDEURL).toBe("https://github.com/sugarlabs/turtleblocksjs/tree/master/guide/README.md"); |
| 38 | + }); |
| 39 | + |
| 40 | + test("TITLESTRING should be defined", () => { |
| 41 | + expect(TITLESTRING).toBeDefined(); |
| 42 | + }); |
| 43 | + |
| 44 | + test("createDefaultStack function should be callable", () => { |
| 45 | + expect(typeof createDefaultStack).toBe("function"); |
| 46 | + }); |
| 47 | +}); |
0 commit comments