Bug 38201: install i18n on mount for component testing

(cherry picked from commit 5a78bc6fbfcb25d5b62e029f2cb6feacf17e8396)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2025-07-30 12:09:21 +02:00 committed by Lucas Gass
parent e18cd933f2
commit 65fd882fa8
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 10 additions and 3 deletions

View File

@ -149,7 +149,6 @@ import LinkWrapper from "./LinkWrapper.vue";
import AdditionalFieldsDisplay from "./AdditionalFieldsDisplay.vue";
import { useBaseElement } from "../composables/base-element.js";
import { computed, defineAsyncComponent } from "vue";
import { $__ } from "@koha-vue/i18n";
export default {
components: { LinkWrapper, AdditionalFieldsDisplay },
@ -197,7 +196,6 @@ export default {
attribute,
formatValue,
radioOptionText,
$__,
};
},
props: {

View File

@ -20,6 +20,7 @@
// require('./commands')
import { mount } from "cypress/vue";
import i18n from "@koha-vue/i18n";
// Augment the Cypress namespace to include type definitions for
// your custom command.
@ -33,7 +34,15 @@ import { mount } from "cypress/vue";
// }
// };
Cypress.Commands.add("mount", mount);
Cypress.Commands.add("mount", (component, options = {}) => {
return mount(component, {
global: {
plugins: [i18n, ...(options.global?.plugins || [])],
...options.global,
},
...options,
});
});
// Example use:
// cy.mount(MyComponent)