feature: Filtering conversations and contacts with custom attributes (#3851)
This commit is contained in:
9
app/javascript/shared/mixins/specs/MockComponent.vue
Normal file
9
app/javascript/shared/mixins/specs/MockComponent.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<div class="test"></div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'MockComponent',
|
||||
};
|
||||
</script>
|
||||
29
app/javascript/shared/mixins/specs/filterFixtures.js
Normal file
29
app/javascript/shared/mixins/specs/filterFixtures.js
Normal file
@@ -0,0 +1,29 @@
|
||||
export const filterGroups = [
|
||||
{
|
||||
name: 'Standard Filters',
|
||||
attributes: [
|
||||
{ key: 'status', name: 'Status' },
|
||||
{ key: 'assignee_id', name: 'Assignee Name' },
|
||||
{ key: 'inbox_id', name: 'Inbox Name' },
|
||||
{ key: 'team_id', name: 'Team Name' },
|
||||
{ key: 'display_id', name: 'Conversation Identifier' },
|
||||
{ key: 'campaign_id', name: 'Campaign Name' },
|
||||
{ key: 'labels', name: 'Labels' },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Additional Filters',
|
||||
attributes: [
|
||||
{ key: 'browser_language', name: 'Browser Language' },
|
||||
{ key: 'country_code', name: 'Country Name' },
|
||||
{ key: 'referer', name: 'Referer link' },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Custom Attributes',
|
||||
attributes: [
|
||||
{ key: 'signed_up_at', name: 'Signed Up At' },
|
||||
{ key: 'test', name: 'Test' },
|
||||
],
|
||||
},
|
||||
];
|
||||
13
app/javascript/shared/mixins/specs/filterMixin.spec.js
Normal file
13
app/javascript/shared/mixins/specs/filterMixin.spec.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import filterMixin from '../filterMixin';
|
||||
import { shallowMount } from '@vue/test-utils';
|
||||
import MockComponent from './MockComponent.vue';
|
||||
|
||||
describe('Test mixin function', () => {
|
||||
const wrapper = shallowMount(MockComponent, {
|
||||
mixins: [filterMixin],
|
||||
});
|
||||
|
||||
it('should return proper value from bool', () => {
|
||||
expect(wrapper.vm.setFilterAttributes).toBeTruthy();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user