Commit 7a2e2a3b authored by davelopez's avatar davelopez
Browse files

Fix ReviewCleanupDialog state

The `static` property of the modal should be used only for testing, otherwise, the modal will retain the table contents of the first plugin that opened it.
parent cdf1d183
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -36,7 +36,11 @@ const FAKE_OPERATION = () => {
};

async function mountReviewCleanupDialogWith(operation, totalItems = EXPECTED_TOTAL_ITEMS) {
    const wrapper = mount(ReviewCleanupDialog, { propsData: { operation, totalItems, show: true } }, localVue);
    const wrapper = mount(
        ReviewCleanupDialog,
        { propsData: { operation, totalItems, show: true, modalStatic: true } },
        localVue
    );
    await flushPromises();
    return wrapper;
}
+14 −1
Original line number Diff line number Diff line
<template>
    <b-modal id="review-cleanup-dialog" v-model="showDialog" title-tag="h2" centered static @show="onShowModal">
    <b-modal
        id="review-cleanup-dialog"
        v-model="showDialog"
        title-tag="h2"
        :static="modalStatic"
        centered
        @show="onShowModal">
        <template v-slot:modal-title>
            {{ title }}
            <span class="text-primary h3">{{ totalItems }}<span v-if="rowLimitReached">+</span> items</span>
@@ -98,6 +104,10 @@ export default {
            type: Boolean,
            required: false,
        },
        modalStatic: {
            type: Boolean,
            required: false,
        },
    },
    data() {
        return {
@@ -185,6 +195,9 @@ export default {
        },
    },
    watch: {
        operation() {
            this.currentPage = 1;
        },
        totalItems(newVal) {
            this.totalRows = newVal;
        },