Initial commit of 001code-html Scratch frontend project.
Includes scratch-gui, scratch-vm, scratch-blocks, scratch-render, scratch-l10n, and deployment config. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
44
scratch-gui/test/integration/backpack.test.js
Normal file
44
scratch-gui/test/integration/backpack.test.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import path from 'path';
|
||||
import SeleniumHelper from '../helpers/selenium-helper';
|
||||
|
||||
const {
|
||||
clickText,
|
||||
getDriver,
|
||||
getLogs,
|
||||
loadUri
|
||||
} = new SeleniumHelper();
|
||||
|
||||
const uri = path.resolve(__dirname, '../../build/index.html');
|
||||
|
||||
let driver;
|
||||
|
||||
describe('Working with the how-to library', () => {
|
||||
beforeAll(() => {
|
||||
driver = getDriver();
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await driver.quit();
|
||||
});
|
||||
|
||||
test('Backpack is "Coming Soon" without backpack host param', async () => {
|
||||
await loadUri(uri);
|
||||
// Check that the backpack header is visible and wrapped in a coming soon tooltip
|
||||
await clickText('Backpack', '*[@data-for="backpack-tooltip"]');
|
||||
const logs = await getLogs();
|
||||
await expect(logs).toEqual([]);
|
||||
});
|
||||
|
||||
test('Backpack can be expanded with backpack host param', async () => {
|
||||
await loadUri(`${uri}?backpack_host=https://backpack.scratch.mit.edu`);
|
||||
|
||||
// Try activating the backpack from the costumes tab to make sure it isn't pushed off
|
||||
await clickText('Costumes');
|
||||
|
||||
// Check that the backpack header is visible and wrapped in a coming soon tooltip
|
||||
await clickText('Backpack'); // Not wrapped in tooltip
|
||||
await clickText('Backpack is empty'); // Make sure it can expand, is empty
|
||||
const logs = await getLogs();
|
||||
await expect(logs).toEqual([]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user