import expect from '@kbn/expect' ; import { FtrProviderContext } from '../services' ; import { LicensingPluginSetup } from '../../../plugins/licensing/public' ; import { createScenario } from '../scenario' ; import '../../../../test/plugin_functional/plugins/core_provider_plugin/types' ; export default function ( ftrContext ) { const { getService } = ftrContext ; const testSubjects = getService ( 'testSubjects' ) ; const browser = getService ( 'browser' ) ; const scenario = createScenario ( ftrContext ) ; describe . skip ( 'changes in license types' , ( ) => { after ( async ( ) => { await scenario . teardown ( ) ; } ) ; it ( 'provides changes in license types' , async ( ) => { await scenario . setup ( ) ; await scenario . waitForPluginToDetectLicenseUpdate ( ) ; expect ( await browser . executeAsync ( async ( cb ) => { const { setup , testUtils } = window . _coreProvider ; await setup . core . http . get ( '/' ) ; await testUtils . delay ( 1000 ) ; const licensing = setup . plugins . licensing ; licensing . license$ . subscribe ( ( license ) => cb ( license . type ) ) ; } ) ) . to . be ( 'basic' ) ; await scenario . waitForPluginToDetectLicenseUpdate ( ) ; expect ( await browser . executeAsync ( async ( cb ) => { const { setup , testUtils } = window . _coreProvider ; await setup . core . http . get ( '/' ) ; await testUtils . delay ( 1000 ) ; const licensing = setup . plugins . licensing ; licensing . license$ . subscribe ( ( license ) => cb ( license . type ) ) ; } ) ) . to . be ( 'basic' ) ; await scenario . startTrial ( ) ; await scenario . waitForPluginToDetectLicenseUpdate ( ) ; expect ( await browser . executeAsync ( async ( cb ) => { const { setup , testUtils } = window . _coreProvider ; await setup . core . http . get ( '/' ) ; await testUtils . delay ( 1000 ) ; const licensing = setup . plugins . licensing ; licensing . license$ . subscribe ( ( license ) => cb ( license . type ) ) ; } ) ) . to . be ( 'trial' ) ; await scenario . startBasic ( ) ; await scenario . waitForPluginToDetectLicenseUpdate ( ) ; expect ( await browser . executeAsync ( async ( cb ) => { const { setup , testUtils } = window . _coreProvider ; await setup . core . http . get ( '/' ) ; await testUtils . delay ( 1000 ) ; const licensing = setup . plugins . licensing ; licensing . license$ . subscribe ( ( license ) => cb ( license . type ) ) ; } ) ) . to . be ( 'basic' ) ; await testSubjects . missingOrFail ( 'licenseExpiredBanner' ) ; } ) ; } ) ; }