{"version":3,"sources":["lib/authMgr/spec/authControlSpec.ts"],"names":[],"mappings":"","file":"../../../../lib/authMgr/spec/authControlSpec.d.ts","sourcesContent":["import { getSharedState } from '../../../common/appContext/sharedState.js';\nimport { sleep } from '../../../common/mutexHelper.js';\nimport { getStage } from '../../test/util.js';\nimport { LittleAuthController } from '../authControl.js';\n\nimport { LittleAuthUI, newUserInfo, stateKey } from '../authUi.js';\n\ndescribe('the lw-auth-control custom element', () => {\n  it('Can dance', () => {\n    expect(true).toBe(true);\n  });\n\n  it('Can render an lw-auth-control', async (done) => {\n    const stage = getStage('authcontrol1', 'LittleAuthController');\n    // TODO - mock out the fetch api that the controller uses\n    const control = document.createElement('lw-auth-control') as LittleAuthController;\n    const ui = document.createElement('lw-auth-ui') as LittleAuthUI;\n    // 6 degrees === 1 minute\n    stage.appendChild(control);\n    stage.appendChild(ui);\n    // Give browser chance to render\n    await sleep(1000);\n    expect(stage.querySelectorAll('lw-auth-control').length).toBe(1);\n    expect(stage.querySelectorAll('lw-auth-ui').length).toBe(1);\n    const state = await getSharedState();\n    const testUser = 'testUser';\n    await state.changeState(stateKey, () => newUserInfo(testUser));\n    await sleep(100); // wait for state to propogate\n    expect(ui.user).toBe(testUser);\n    done();\n  });\n});\n"]}