@ -3,7 +3,7 @@
* page , both for anonymous and logged - in users .
* /
import { assert , driver , Key, stackWrapFunc, WebElement } from 'mocha-webdriver' ;
import { assert , driver , stackWrapFunc, WebElement } from 'mocha-webdriver' ;
import * as gu from 'test/nbrowser/gristUtils' ;
import { server , setupTestSuite } from 'test/nbrowser/testUtils' ;
@ -42,42 +42,6 @@ describe('HomeIntro', function() {
it ( 'should render selected Examples workspace specially' , testSelectedExamplesPage ) ;
} ) ;
describe ( "Viewer on a team site" , function ( ) {
it ( 'should show welcome for viewers' , async function ( ) {
// Sign in as to a team that has no docs.
await server . simulateLogin ( "Chimpy" , "chimpy@getgrist.com" , "FreeTeam" ) ;
await driver . get ( server . getUrl ( 'freeteam' , '' ) ) ;
await gu . editOrgAcls ( ) ;
const orgInput = await driver . find ( '.test-um-member-new input' ) ;
await orgInput . sendKeys ( 'charon@getgrist.com' , Key . ENTER ) ;
await gu . saveAcls ( ) ;
await gu . removeLogin ( ) ;
await server . simulateLogin ( "Charon" , "charon@getgrist.com" , "abyss" ) ;
await driver . get ( server . getUrl ( 'freeteam' , '' ) ) ;
// Check message specific to logged-in user and an empty team site.
assert . match ( await driver . findWait ( '.test-welcome-title' , 1000 ) . getText ( ) , new RegExp ( ` Welcome.* FreeTeam ` ) ) ;
assert . match ( await driver . find ( '.test-welcome-info' ) . getText ( ) ,
/You have read-only access to this site.*/ ) ;
assert . match ( await driver . find ( '.test-welcome-text' ) . getText ( ) ,
/Interested in using Grist outside of your team\? Visit your free, personal site\./ ) ;
assert . notMatch ( await driver . find ( '.test-welcome-text' ) . getText ( ) , /sign up/ ) ;
await driver . find ( ".test-welcome-personal-url" ) . click ( ) ;
await gu . waitForDocMenuToLoad ( ) ;
assert . equal (
await driver . find ( '.test-dm-other-sites-message' ) . getText ( ) ,
'You are on your personal site. You also have access to the following sites:'
) ;
await driver . get ( server . getUrl ( 'freeteam' , '' ) ) ;
await gu . waitForDocMenuToLoad ( ) ;
} ) ;
it ( 'should not show Other Sites section' , testOtherSitesSection ) ;
it ( 'should not show welcome buttons' , testNoButtonsOnHome ) ;
it ( 'should show examples workspace with the intro' , testExamplesSection ) ;
it ( 'should render selected Examples workspace specially' , testSelectedExamplesPage ) ;
} ) ;
describe ( "Logged-in on merged-org" , function ( ) {
it ( 'should show welcome for logged-in user' , async function ( ) {
// Sign in as a new user who has no docs.
@ -153,13 +117,6 @@ describe('HomeIntro', function() {
}
}
async function testNoButtonsOnHome() {
const buttons = [ 'test-intro-templates' , 'test-intro-import-doc' , 'test-intro-create-doc' ] ;
for ( const button of buttons ) {
assert . isFalse ( await driver . find ( ` . ${ button } ` ) . isPresent ( ) ) ;
}
}
async function testCreateImport ( isLoggedIn : boolean ) {
// Create doc from intro button
await driver . find ( '.test-intro-create-doc' ) . click ( ) ;