From 94ca8e07f48eb2c768af89473a245eb0d588f709 Mon Sep 17 00:00:00 2001 From: Miguel Rincon Date: Wed, 17 Dec 2025 17:34:15 +0100 Subject: [PATCH] Clean unused test files --- .../keep_alive_component_helper.js | 29 ------------------- .../keep_alive_component_helper_spec.js | 28 ------------------ 2 files changed, 57 deletions(-) delete mode 100644 spec/frontend/__helpers__/keep_alive_component_helper.js delete mode 100644 spec/frontend/__helpers__/keep_alive_component_helper_spec.js diff --git a/spec/frontend/__helpers__/keep_alive_component_helper.js b/spec/frontend/__helpers__/keep_alive_component_helper.js deleted file mode 100644 index 54f40bf9093a7c..00000000000000 --- a/spec/frontend/__helpers__/keep_alive_component_helper.js +++ /dev/null @@ -1,29 +0,0 @@ -import Vue from 'vue'; - -export function keepAlive(KeptAliveComponent) { - return Vue.extend({ - components: { - KeptAliveComponent, - }, - data() { - return { - view: 'KeptAliveComponent', - }; - }, - methods: { - async activate() { - this.view = 'KeptAliveComponent'; - await this.$nextTick(); - }, - async deactivate() { - this.view = 'div'; - await this.$nextTick(); - }, - async reactivate() { - await this.deactivate(); - await this.activate(); - }, - }, - template: ``, - }); -} diff --git a/spec/frontend/__helpers__/keep_alive_component_helper_spec.js b/spec/frontend/__helpers__/keep_alive_component_helper_spec.js deleted file mode 100644 index 8b6cdedfd9f4f5..00000000000000 --- a/spec/frontend/__helpers__/keep_alive_component_helper_spec.js +++ /dev/null @@ -1,28 +0,0 @@ -import { mount } from '@vue/test-utils'; -import { keepAlive } from './keep_alive_component_helper'; - -const component = { - template: '
Test Component
', -}; - -describe('keepAlive', () => { - let wrapper; - - beforeEach(() => { - wrapper = mount(keepAlive(component)); - }); - - it('converts a component to a keep-alive component', async () => { - const { element } = wrapper.findComponent(component); - - await wrapper.vm.deactivate(); - expect(wrapper.findComponent(component).exists()).toBe(false); - - await wrapper.vm.activate(); - - // assert that when the component is destroyed and re-rendered, the - // newly rendered component has the reference to the old component - // (i.e. the old component was deactivated and activated) - expect(wrapper.findComponent(component).element).toBe(element); - }); -}); -- GitLab