Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@ export interface STF_API {
*/
env?: Object

/**
* A flags object override for testing with specific feature toggle setting.
*/
flags?: Object

/**
* Definition of SAP Web IDE plugin transformation that happens BEFORE
* any plugins are registered in the "pluginRegistry". This allows using mock
Expand Down
7 changes: 6 additions & 1 deletion resources/local_env/webide_starter.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ var DEFAULT_START_WEBIDE_OPTIONS = {
extra_url_params: {},
backend: "IN_MEMORY",
env: localEnvJson,
flags: {},
featureConfig: DEFAULT_FEATURE_CONFIG
}

Expand Down Expand Up @@ -223,7 +224,11 @@ function startWebIDE(options) {
actualOptions.featureConfig
)

iframe.contentWindow.WEB_IDE_ENV_JSON_OVERRIDE = actualOptions.env
iframe.contentWindow.WEB_IDE_ENV_JSON_OVERRIDE = _.assign(
{},
actualOptions.env,
{ flags: actualOptions.flags }
)

return deferred.promise.then(function(PluginRegistry) {
return {
Expand Down
7 changes: 6 additions & 1 deletion resources/tests/serviceTestFramework.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ define("STF", [
pluginsTransformDef: { add: [], remove: [] },
mocks: [IN_MEMORY_BACKEND],
env: localEnvJson,
flags: {},
html: "/base/node_modules/webide/src/main/webapp/index.html",
ui5Root:
"https://sapui5.hana.ondemand.com/" + ui5Version.version + "/resources/",
Expand Down Expand Up @@ -257,7 +258,11 @@ define("STF", [
)
iframe.contentWindow.WEB_IDE_FEATURE_CONFIG_OVERRIDE =
actualOptions.featureConfig
iframe.contentWindow.WEB_IDE_ENV_JSON_OVERRIDE = actualOptions.env
iframe.contentWindow.WEB_IDE_ENV_JSON_OVERRIDE = _.assign(
{},
actualOptions.env,
{ flags: actualOptions.flags }
)

return serviceRegistryDeferred.promise.then(function(PluginRegistry) {
window.WEB_IDE_PLUGIN_REG[suiteName] = PluginRegistry
Expand Down