Skip to content
Snippets Groups Projects
Commit 90d0c14b authored by chrisgarrity's avatar chrisgarrity
Browse files

Add tests

parent 9d8c80b6
No related branches found
No related tags found
No related merge requests found
import path from 'path';
import SeleniumHelper from '../helpers/selenium-helper';
const {
clickText,
findByXpath,
getDriver,
loadUri
} = new SeleniumHelper();
const uri = path.resolve(__dirname, '../../build/index.html?tutorial=all');
let driver;
describe('Working with shortcut to Tutorials library', () => {
beforeAll(() => {
driver = getDriver();
});
afterAll(async () => {
await driver.quit();
});
test('opens with the Tutorial Library showing', async () => {
await loadUri(uri);
// make sure there is a tutorial visible that doesn't have a shortcut
await clickText('Switch costume');
await findByXpath('//div[contains(@class, "step-video")]');
});
// @todo navigating cards, etc.
});
......@@ -36,7 +36,7 @@ test('returns null if no query param', () => {
expect(detectTutorialId()).toBe(null);
});
test('returns null if non-numeric template', () => {
test('returns null if unrecognized template', () => {
window.location.search = '?tutorial=asdf';
expect(detectTutorialId()).toBe(null);
});
......@@ -45,3 +45,8 @@ test('takes the first of multiple', () => {
window.location.search = '?tutorial=one&tutorial=two';
expect(detectTutorialId()).toBe('foo');
});
test('returns all for the tutorial library shortcut', () => {
window.location.search = '?tutorial=all';
expect(detectTutorialId()).toBe('all');
});
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