Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 7 additions & 16 deletions resources/js/Components/MismatchesTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,18 @@
</wikit-table>
</template>

<script lang="ts">
import type { PropType } from 'vue';
import { defineComponent } from 'vue';
<script setup lang="ts">
import { Table as WikitTable } from '@wmde/wikit-vue-components';

import MismatchRow from './MismatchRow.vue';

import { LabelledMismatch } from '../types/Mismatch';
import type { LabelledMismatch } from '../types/Mismatch';

export default defineComponent({
components: {
MismatchRow,
WikitTable,
},
props: {
mismatches: Array as PropType<LabelledMismatch[]>,
disabled: {
type: Boolean,
default: false
}
}
withDefaults(defineProps<{
mismatches: LabelledMismatch[],
disabled: boolean
}>(), {
disabled: false
});
</script>

Expand Down
17 changes: 9 additions & 8 deletions tests/Vue/Components/MismatchesTable.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { mount } from '@vue/test-utils';
import MismatchesTable from '@/Components/MismatchesTable.vue';
import MismatchRow from '@/Components/MismatchRow.vue';
import { createI18n } from 'vue-banana-i18n';

const i18n = createI18n({
messages: {},
locale: 'en',
wikilinks: true
});

describe('MismatchesTable.vue', () => {
it('accepts a mismatches property', () => {
Expand All @@ -22,10 +29,7 @@ describe('MismatchesTable.vue', () => {
const wrapper = mount(MismatchesTable, {
props: { mismatches },
global: {
mocks: {
// Mock the banana-i18n plugin dependency
$i18n: key => key
}
plugins: [i18n]
}
});

Expand Down Expand Up @@ -59,10 +63,7 @@ describe('MismatchesTable.vue', () => {
const wrapper = mount(MismatchesTable, {
props: { disabled, mismatches },
global: {
mocks: {
// Mock the banana-i18n plugin dependency
$i18n: key => key
}
plugins: [i18n]
}
});

Expand Down