-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for custom regions, by detecting what is used in index.ht…
…ml (#3518) read index.html to discover the regions used, make them the list checked by app.js and check:config test fixes #3504 supercedes #3506 no config.js param required
- Loading branch information
Showing
11 changed files
with
154 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
let config = { | ||
modules: | ||
// Using exotic content. This is why don't accept go to JSON configuration file | ||
(() => { | ||
let positions = ["row3_left", "top3_left1"]; | ||
let modules = Array(); | ||
for (let idx in positions) { | ||
modules.push({ | ||
module: "helloworld", | ||
position: positions[idx], | ||
config: { | ||
text: `Text in ${positions[idx]}` | ||
} | ||
}); | ||
} | ||
return modules; | ||
})() | ||
}; | ||
|
||
/*************** DO NOT EDIT THE LINE BELOW ***************/ | ||
if (typeof module !== "undefined") { | ||
module.exports = config; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const helpers = require("./helpers/global-setup"); | ||
|
||
describe("Custom Position of modules", () => { | ||
beforeAll(async () => { | ||
await helpers.fixupIndex(); | ||
await helpers.startApplication("tests/configs/customregions.js"); | ||
await helpers.getDocument(); | ||
}); | ||
afterAll(async () => { | ||
await helpers.stopApplication(); | ||
await helpers.restoreIndex(); | ||
}); | ||
|
||
const positions = ["row3_left", "top3_left1"]; | ||
let i = 0; | ||
const className1 = positions[i].replace("_", "."); | ||
let message1 = positions[i]; | ||
it(`should show text in ${message1}`, async () => { | ||
const elem = await helpers.waitForElement(`.${className1}`); | ||
expect(elem).not.toBeNull(); | ||
expect(elem.textContent).toContain(`Text in ${message1}`); | ||
}); | ||
i = 1; | ||
const className2 = positions[i].replace("_", "."); | ||
let message2 = positions[i]; | ||
it(`should NOT show text in ${message2}`, async () => { | ||
const elem = await helpers.waitForElement(`.${className2}`, "", 1500); | ||
expect(elem).toBeNull(); | ||
}, 1510); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters