@ -21,17 +21,6 @@ describe('FormView', function() {
afterEach ( ( ) = > gu . checkForErrors ( ) ) ;
before ( async function ( ) {
const session = await gu . session ( ) . login ( ) ;
docId = await session . tempNewDoc ( cleanup ) ;
api = session . createHomeApi ( ) ;
await driver . executeScript ( createClipboardTextArea ) ;
} ) ;
after ( async function ( ) {
await driver . executeScript ( removeClipboardTextArea ) ;
} ) ;
/ * *
* Adds a temporary textarea to the document for pasting the contents of
* the clipboard .
@ -123,6 +112,18 @@ describe('FormView', function() {
assert . deepEqual ( await api . getTable ( docId , 'Table1' ) . then ( t = > t . D ) , values ) ;
}
describe ( 'on personal site' , async function ( ) {
before ( async function ( ) {
const session = await gu . session ( ) . login ( ) ;
docId = await session . tempNewDoc ( cleanup ) ;
api = session . createHomeApi ( ) ;
await driver . executeScript ( createClipboardTextArea ) ;
} ) ;
after ( async function ( ) {
await driver . executeScript ( removeClipboardTextArea ) ;
} ) ;
it ( 'updates creator panel when navigated away' , async function ( ) {
// Add 2 new pages.
await gu . addNewPage ( 'Form' , 'New Table' , { tableName : 'TabA' } ) ;
@ -1189,6 +1190,39 @@ describe('FormView', function() {
assert . deepEqual ( await readLabels ( ) , [ 'A' , 'B' , 'C' ] ) ;
} ) ;
} ) ;
} ) ;
describe ( 'on team site' , async function ( ) {
before ( async function ( ) {
const session = await gu . session ( ) . teamSite . login ( ) ;
docId = await session . tempNewDoc ( cleanup ) ;
api = session . createHomeApi ( ) ;
await driver . executeScript ( createClipboardTextArea ) ;
} ) ;
after ( async function ( ) {
await driver . executeScript ( removeClipboardTextArea ) ;
} ) ;
it ( 'can submit a form' , async function ( ) {
// A bug was preventing this by forcing a login redirect from the public form URL.
const formUrl = await createFormWith ( 'Text' ) ;
await gu . removeLogin ( ) ;
// We are in a new window.
await gu . onNewTab ( async ( ) = > {
await driver . get ( formUrl ) ;
await driver . findWait ( 'input[name="D"]' , 1000 ) . click ( ) ;
await gu . sendKeys ( 'Hello World' ) ;
await driver . find ( 'input[type="submit"]' ) . click ( ) ;
await waitForConfirm ( ) ;
} ) ;
// Make sure we see the new record.
const session = await gu . session ( ) . teamSite . login ( ) ;
await session . loadDoc ( ` /doc/ ${ docId } ` ) ;
await expectSingle ( 'Hello World' ) ;
await removeForm ( ) ;
} ) ;
} ) ;
} ) ;
function element ( type : string , parent? : WebElement ) : ExtraElement ;