Fix: Debugger showing previous application logs (#4455)

This commit is contained in:
akash-codemonk 2021-05-17 15:31:22 +05:30 committed by GitHub
parent 6bf7903570
commit cbace9d5d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 0 deletions

View File

@ -1,4 +1,6 @@
const dsl = require("../../../../fixtures/buttondsl.json");
const commonlocators = require("../../../../locators/commonlocators.json");
const debuggerLocators = require("../../../../locators/Debugger.json");
describe("Debugger logs", function() {
before(() => {
@ -11,4 +13,18 @@ describe("Debugger logs", function() {
cy.get(".t--debugger").click();
cy.get(".t--debugger-log-state").contains("Test");
});
it("Reset debugger state", function() {
cy.get(".t--property-control-visible")
.find(".t--js-toggle")
.click();
cy.testJsontext("visible", "Test");
cy.get(commonlocators.homeIcon).click({ force: true });
cy.generateUUID().then((id) => {
cy.CreateAppInFirstListedOrg(id);
cy.contains(debuggerLocators.debuggerIcon, 0);
});
});
});

View File

@ -0,0 +1,3 @@
{
"debuggerIcon": ".t--debugger"
}

View File

@ -29,3 +29,7 @@ export const updateErrorLog = (payload: Message) => ({
type: ReduxActionTypes.DEBUGGER_UPDATE_ERROR_LOG,
payload,
});
export const resetDebuggerState = () => ({
type: ReduxActionTypes.RESET_DEBUGGER_STATE,
});

View File

@ -76,6 +76,7 @@ export const ReduxActionTypes: { [key: string]: string } = {
DEBUGGER_UPDATE_ERROR_LOG: "DEBUGGER_UPDATE_ERROR_LOG",
DEBUGGER_UPDATE_ERROR_LOGS: "DEBUGGER_UPDATE_ERROR_LOGS",
CLEAR_DEBUGGER_LOGS: "CLEAR_DEBUGGER_LOGS",
RESET_DEBUGGER_STATE: "RESET_DEBUGGER_STATE",
SHOW_DEBUGGER: "SHOW_DEBUGGER",
SET_THEME: "SET_THEME",
FETCH_WIDGET_CARDS: "FETCH_WIDGET_CARDS",

View File

@ -105,6 +105,11 @@ const debuggerReducer = createReducer(initialState, {
errors: { ...action.payload },
};
},
[ReduxActionTypes.RESET_DEBUGGER_STATE]: () => {
return {
...initialState,
};
},
});
export interface DebuggerReduxState {

View File

@ -46,6 +46,7 @@ import PerformanceTracker, {
PerformanceTransactionName,
} from "utils/PerformanceTracker";
import { executePageLoadActions } from "actions/widgetActions";
import { resetDebuggerState } from "actions/debuggerActions";
function* failFastApiCalls(
triggerActions: Array<ReduxAction<unknown> | ReduxActionWithoutPayload>,
@ -267,6 +268,7 @@ export function* initializeAppViewerSaga(
function* resetEditorSaga() {
yield put(resetEditorSuccess());
yield put(resetRecentEntities());
yield put(resetDebuggerState());
}
export default function* watchInitSagas() {