diff --git a/contentcuration/contentcuration/frontend/accounts/pages/Create.vue b/contentcuration/contentcuration/frontend/accounts/pages/Create.vue
index b211cd5634..6553feb29f 100644
--- a/contentcuration/contentcuration/frontend/accounts/pages/Create.vue
+++ b/contentcuration/contentcuration/frontend/accounts/pages/Create.vue
@@ -132,7 +132,7 @@
-
diff --git a/contentcuration/contentcuration/frontend/channelEdit/components/AssessmentEditor/AssessmentEditor.spec.js b/contentcuration/contentcuration/frontend/channelEdit/components/AssessmentEditor/AssessmentEditor.spec.js
index 3d04240b13..a2d3b9d5d8 100644
--- a/contentcuration/contentcuration/frontend/channelEdit/components/AssessmentEditor/AssessmentEditor.spec.js
+++ b/contentcuration/contentcuration/frontend/channelEdit/components/AssessmentEditor/AssessmentEditor.spec.js
@@ -73,7 +73,7 @@ const checkShowAnswers = wrapper => {
wrapper
.find('[data-test="showAnswersCheckbox"]')
.find('input')
- .setChecked(true);
+ .element.click();
};
const getItems = wrapper => {
diff --git a/contentcuration/contentcuration/frontend/channelEdit/components/edit/AccessibilityOptions.vue b/contentcuration/contentcuration/frontend/channelEdit/components/edit/AccessibilityOptions.vue
index f54648c0cb..1cea23081b 100644
--- a/contentcuration/contentcuration/frontend/channelEdit/components/edit/AccessibilityOptions.vue
+++ b/contentcuration/contentcuration/frontend/channelEdit/components/edit/AccessibilityOptions.vue
@@ -14,7 +14,7 @@
color="primary"
:data-test="`checkbox-${accessibilityItem.help}`"
>
-
+
{{ accessibilityItem.label }}
{
wrapper.find('[data-test="item"]').trigger('click');
expect(wrapper.vm.previewNodeId).toBe(testChildren[0].id);
});
- it('checking item in list should set selected', () => {
- wrapper.find('[data-test="checkbox"]').vm.$emit('change', ['selected']);
- expect(wrapper.vm.selected).toEqual(['selected']);
+ it('checking item in list should add the item ID to the selected array', () => {
+ wrapper
+ .find('[data-test="checkbox"]')
+ .find('input[type="checkbox"]')
+ .element.click();
+ expect(wrapper.vm.selected).toEqual(['test1']);
});
it('checking select all checkbox should check all items', () => {
wrapper.find('[data-test="selectall"]').vm.$emit('change', true);
diff --git a/contentcuration/contentcuration/frontend/channelList/views/ChannelSet/ChannelSelectionList.vue b/contentcuration/contentcuration/frontend/channelList/views/ChannelSet/ChannelSelectionList.vue
index 05b5ca4eee..f268ecb7f5 100644
--- a/contentcuration/contentcuration/frontend/channelList/views/ChannelSet/ChannelSelectionList.vue
+++ b/contentcuration/contentcuration/frontend/channelList/views/ChannelSet/ChannelSelectionList.vue
@@ -23,7 +23,7 @@
diff --git a/contentcuration/contentcuration/frontend/channelList/views/ChannelSet/__tests__/channelSelectionList.spec.js b/contentcuration/contentcuration/frontend/channelList/views/ChannelSet/__tests__/channelSelectionList.spec.js
index b3d88ee0fb..efdcbf96f5 100644
--- a/contentcuration/contentcuration/frontend/channelList/views/ChannelSet/__tests__/channelSelectionList.spec.js
+++ b/contentcuration/contentcuration/frontend/channelList/views/ChannelSet/__tests__/channelSelectionList.spec.js
@@ -60,13 +60,17 @@ describe('channelSelectionList', () => {
});
it('should select channels when the channel has been checked', () => {
wrapper.setData({ loading: false });
- wrapper.find('[data-test="checkbox"]').vm.$emit('change', [editChannel.id]);
+ wrapper.find(`[data-test="checkbox-${editChannel.id}"]`).element.click();
+
expect(wrapper.emitted('input')[0][0]).toEqual([editChannel.id]);
});
it('should deselect channels when the channel has been unchecked', () => {
wrapper.setData({ loading: false });
- wrapper.find('[data-test="checkbox"]').vm.$emit('change', []);
- expect(wrapper.emitted('input')[0][0]).toEqual([]);
+ wrapper.find(`[data-test="checkbox-${editChannel.id}"]`).element.click(); // Check the channel
+ wrapper.find(`[data-test="checkbox-${editChannel.id}"]`).element.click(); // Uncheck the channel
+
+ expect(wrapper.emitted('input')[0].length).toEqual(1); // Only one event should be emitted (corresponding to the initial check)
+ expect(wrapper.emitted('input')[0][0]).toEqual([editChannel.id]); // The initial check event should be emitted
});
it('should filter channels based on the search text', () => {
wrapper.setData({ loading: false, search: searchWord });
diff --git a/contentcuration/contentcuration/frontend/shared/views/form/Checkbox.vue b/contentcuration/contentcuration/frontend/shared/views/form/Checkbox.vue
index f137545c48..fab75de77f 100644
--- a/contentcuration/contentcuration/frontend/shared/views/form/Checkbox.vue
+++ b/contentcuration/contentcuration/frontend/shared/views/form/Checkbox.vue
@@ -1,21 +1,138 @@
+
+
+
+
+
+
+
+