Skip to content

Commit

Permalink
Unit test error eliminated.
Browse files Browse the repository at this point in the history
  • Loading branch information
msyk committed Feb 5, 2024
1 parent 6dc9f04 commit e8b2708
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions spec/jest-test-suite/INTER-Mediator.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
/* global INTERMediator,buster,INTERMediatorLib,INTERMediatorOnPage,IMLibElement */

const INTERMediator = require('../../src/js/INTER-Mediator')
const INTERMediatorOnPage = require('../../src/js/INTER-Mediator-Page')
INTERMediatorOnPage.getDataSources = () => {
return {}
}

beforeEach(() => {
INTERMediator.clearCondition('context1')
Expand Down
4 changes: 2 additions & 2 deletions src/js/INTER-Mediator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1962,7 +1962,7 @@ const INTERMediator = {
},

clearCondition: (contextName = false, label = false) => {
if(contextName) {
if (contextName) {
let value = INTERMediator.additionalCondition ?? {}
if (value[contextName]) {
if (!label) {
Expand All @@ -1978,7 +1978,7 @@ const INTERMediator = {
INTERMediator.additionalCondition = value
IMLibLocalContext.archive()
}
if (INTERMediatorOnPage.getContextInfo(contextName).paging) {
if (INTERMediatorOnPage.getContextInfo(contextName) && INTERMediatorOnPage.getContextInfo(contextName).paging) {
INTERMediator.startFrom = 0
}
} else { // In case of no parameter.
Expand Down

0 comments on commit e8b2708

Please sign in to comment.