Skip to content

Commit

Permalink
update naming
Browse files Browse the repository at this point in the history
from changeAreaComponent to changeAreaContent
  • Loading branch information
Kurtil committed May 17, 2020
1 parent 229a6e4 commit 50e5964
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cypress/integration/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ describe('Simple area', () => {
it('Should display other component if area component is changed', () => {
cy.get(AREA_SELECTOR).contains("component content 1");

cy.get("@areas").invoke("changeAreaComponent", 1, { componentIndex: 1 });
cy.get("@areas").invoke("changeAreaContent", 1, { componentIndex: 1 });

cy.get(AREA_SELECTOR).contains("component content 2");

cy.get("@areas").invoke("changeAreaComponent", 1, { componentIndex: null });
cy.get("@areas").invoke("changeAreaContent", 1, { componentIndex: null });

cy.get(AREA_SELECTOR).contains(DEFAULT_COMPONENT_TEXT);
});
Expand Down Expand Up @@ -833,7 +833,7 @@ describe('Components must be created only once and cached', () => {
.trigger("mousemove", { clientY: HEIGHT / 2 })
.trigger('mouseup');
cy.get("@areas").invoke("splitArea", 1, "vertical", 20);
cy.get("@areas").invoke("changeAreaComponent", 1, { componentIndex: null });
cy.get("@areas").invoke("changeAreaContent", 1, { componentIndex: null });
cy.get("@areas").invoke("swapAreas", 1, 2);
cy.get("@areas").invoke("deleteArea", 2);

Expand Down
4 changes: 2 additions & 2 deletions src/Areas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export default {
const layout = this.$refs.layout.getLayout();
return this.reverseParseLayout(layout);
},
changeAreaComponent(areaId, componentCfg = {}) {
changeAreaContent(areaId, contentCfg = {}) {
if (
!this.areasContent
.map((areaContent, index) => (areaContent ? index : null))
Expand All @@ -159,7 +159,7 @@ export default {
) {
throw `Impossible to change component. Area id "${areaId}" does not exist.`;
}
const { cfg, componentIndex, name } = componentCfg;
const { cfg, componentIndex, name } = contentCfg;
if (
componentIndex !== null &&
!Object.keys(this.availableComponents).includes(String(componentIndex))
Expand Down

0 comments on commit 50e5964

Please sign in to comment.