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:
parent
e18cd933f2
commit
65fd882fa8
|
|
@ -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: {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue