Skip to content

Commit

Permalink
rename platform hack __coreProvider --> _coreProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov committed Aug 4, 2020
1 parent 7557a82 commit a485064
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class CoreProviderPlugin implements Plugin {
}

public start(core: CoreStart, plugins: Record<string, any>) {
window.__coreProvider = {
window._coreProvider = {
setup: this.setupDeps!,
start: {
core,
Expand Down
8 changes: 4 additions & 4 deletions test/plugin_functional/test_suites/core_plugins/ui_plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide
it('should run the new platform plugins', async () => {
expect(
await browser.execute(() => {
return window.__coreProvider.setup.plugins.core_plugin_b.sayHi();
return window._coreProvider.setup.plugins.core_plugin_b.sayHi();
})
).to.be('Plugin A said: Hello from Plugin A!');
});
Expand All @@ -49,7 +49,7 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide
it('to start services via coreSetup.getStartServices', async () => {
expect(
await browser.executeAsync<boolean>(async (cb) => {
const [coreStart] = await window.__coreProvider.setup.core.getStartServices();
const [coreStart] = await window._coreProvider.setup.core.getStartServices();
cb(Boolean(coreStart.overlays));
})
).to.be(true);
Expand All @@ -76,15 +76,15 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide
it('should send kbn-system-request header when asSystemRequest: true', async () => {
expect(
await browser.executeAsync(async (cb) => {
window.__coreProvider.start.plugins.core_plugin_b.sendSystemRequest(true).then(cb);
window._coreProvider.start.plugins.core_plugin_b.sendSystemRequest(true).then(cb);
})
).to.be('/core_plugin_b/system_request says: "System request? true"');
});

it('should not send kbn-system-request header when asSystemRequest: false', async () => {
expect(
await browser.executeAsync(async (cb) => {
window.__coreProvider.start.plugins.core_plugin_b.sendSystemRequest(false).then(cb);
window._coreProvider.start.plugins.core_plugin_b.sendSystemRequest(false).then(cb);
})
).to.be('/core_plugin_b/system_request says: "System request? false"');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide

it('client plugins have access to registered settings', async () => {
const settings = await browser.execute(() => {
return window.__coreProvider.setup.core.uiSettings.getAll().ui_settings_plugin;
return window._coreProvider.setup.core.uiSettings.getAll().ui_settings_plugin;
});

expect(settings).to.eql({
Expand All @@ -43,13 +43,13 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide
});

const settingsValue = await browser.execute(() => {
return window.__coreProvider.setup.core.uiSettings.get('ui_settings_plugin');
return window._coreProvider.setup.core.uiSettings.get('ui_settings_plugin');
});

expect(settingsValue).to.be('2');

const settingsValueViaObservables = await browser.executeAsync(async (callback) => {
window.__coreProvider.setup.core.uiSettings
window._coreProvider.setup.core.uiSettings
.get$('ui_settings_plugin')
.subscribe((v) => callback(v));
});
Expand Down
8 changes: 4 additions & 4 deletions x-pack/test/licensing_plugin/public/updates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function (ftrContext: FtrProviderContext) {

expect(
await browser.executeAsync(async (cb) => {
const { setup, testUtils } = window.__coreProvider;
const { setup, testUtils } = window._coreProvider;
// this call enforces signature check to detect license update
// and causes license re-fetch
await setup.core.http.get('/');
Expand All @@ -44,7 +44,7 @@ export default function (ftrContext: FtrProviderContext) {

expect(
await browser.executeAsync(async (cb) => {
const { setup, testUtils } = window.__coreProvider;
const { setup, testUtils } = window._coreProvider;
// this call enforces signature check to detect license update
// and causes license re-fetch
await setup.core.http.get('/');
Expand All @@ -60,7 +60,7 @@ export default function (ftrContext: FtrProviderContext) {

expect(
await browser.executeAsync(async (cb) => {
const { setup, testUtils } = window.__coreProvider;
const { setup, testUtils } = window._coreProvider;
// this call enforces signature check to detect license update
// and causes license re-fetch
await setup.core.http.get('/');
Expand All @@ -76,7 +76,7 @@ export default function (ftrContext: FtrProviderContext) {

expect(
await browser.executeAsync(async (cb) => {
const { setup, testUtils } = window.__coreProvider;
const { setup, testUtils } = window._coreProvider;
// this call enforces signature check to detect license update
// and causes license re-fetch
await setup.core.http.get('/');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {

const findResultsWithAPI = async (t: string): Promise<GlobalSearchResult[]> => {
return browser.executeAsync(async (term, cb) => {
const { start } = window.__coreProvider;
const { start } = window._coreProvider;
const globalSearchTestApi: GlobalSearchTestApi = start.plugins.globalSearchTest;
globalSearchTestApi.findTest(term).then(cb);
}, t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {

const findResultsWithAPI = async (t: string): Promise<GlobalSearchResult[]> => {
return browser.executeAsync(async (term, cb) => {
const { start } = window.__coreProvider;
const { start } = window._coreProvider;
const globalSearchTestApi: GlobalSearchTestApi = start.plugins.globalSearchTest;
globalSearchTestApi.findReal(term).then(cb);
}, t);
Expand Down

0 comments on commit a485064

Please sign in to comment.