gristlabs_grist-core/test/nbrowser/HomeIntroWithoutPlaygound.ts
George Gevoian da6c39aa50 (core) Add new home page cards
Summary:
New cards on the home page link to useful resources like the welcome
video, tutorial, webinars, and the Help Center. They are shown by
default to new and exisiting users, and may be hidden via a toggle.

Test Plan: Browser tests.

Reviewers: jarek

Reviewed By: jarek

Differential Revision: https://phab.getgrist.com/D4340
2024-09-17 17:32:10 -04:00

32 lines
1.3 KiB
TypeScript

import {assert, driver} from 'mocha-webdriver';
import * as gu from 'test/nbrowser/gristUtils';
import {setupTestSuite} from 'test/nbrowser/testUtils';
describe('HomeIntroWithoutPlayground', function() {
this.timeout(20000);
setupTestSuite({samples: true});
gu.withEnvironmentSnapshot({'GRIST_ANON_PLAYGROUND': false});
describe("Anonymous on merged-org", function() {
it('should show welcome page', async function () {
const session = await gu.session().personalSite.anon.login();
await session.loadDocMenu('/');
assert.equal(await driver.find('.test-welcome-title').getText(), 'Welcome to Grist!');
});
it('should not allow creating new documents', async function () {
const session = await gu.session().personalSite.anon.login();
await session.loadDocMenu('/');
// Check that the Add New button is disabled.
assert.equal(await driver.find('.test-dm-add-new').matches('[class*=-disabled]'), true);
await driver.find('.test-dm-add-new').doClick();
assert.equal(await driver.find('.test-dm-new-doc').isPresent(), false);
// Check that the intro buttons are also disabled.
assert.equal(await driver.find('.test-intro-create-doc').getAttribute('disabled'), 'true');
assert.equal(await driver.find('.test-intro-import-doc').getAttribute('disabled'), 'true');
});
});
});