@farm-investimentos/front-mfe-components 2.2.7 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/front-mfe-components.common.js +511 -77
  2. package/dist/front-mfe-components.common.js.map +1 -1
  3. package/dist/front-mfe-components.css +1 -1
  4. package/dist/front-mfe-components.umd.js +511 -77
  5. package/dist/front-mfe-components.umd.js.map +1 -1
  6. package/dist/front-mfe-components.umd.min.js +1 -1
  7. package/dist/front-mfe-components.umd.min.js.map +1 -1
  8. package/package.json +76 -76
  9. package/src/components/AlertReload/AlertReload.vue +34 -32
  10. package/src/components/AlertReload/__tests__/AlertReload.spec.js +18 -0
  11. package/src/components/Buttons/ExportButton/__tests__/ExportButton.spec.js +16 -0
  12. package/src/components/Buttons/ImportButton/__tests__/ImportButton.spec.js +16 -0
  13. package/src/components/Buttons/RemoveButton/__tests__/RemoveButton.spec.js +16 -0
  14. package/src/components/Buttons/ToggleButton/__tests__/ToggleButton.spec.js +14 -0
  15. package/src/components/CardContext/CardContext.scss +46 -0
  16. package/src/components/CardContext/CardContext.stories.js +47 -0
  17. package/src/components/CardContext/CardContext.vue +96 -0
  18. package/src/components/CardContext/__tests__/CardContext.spec.js +20 -0
  19. package/src/components/CardContext/index.js +3 -0
  20. package/src/components/DataTableHeader/DataTableHeader.stories.js +1 -1
  21. package/src/components/DataTableHeader/DataTableHeader.vue +10 -3
  22. package/src/components/DataTableHeader/__tests__/DataTableHeader.spec.js +89 -0
  23. package/src/components/DataTablePaginator/__tests__/DataTablePaginator.spec.js +20 -0
  24. package/src/components/DatePicker/__tests__/DatePicker.spec.js +24 -0
  25. package/src/components/DefaultTextField/__tests__/DefaultTextField.spec.js +25 -0
  26. package/src/components/DialogFooter/__tests__/DialogFooter.spec.js +20 -0
  27. package/src/components/DialogHeader/__tests__/DialogHeader.spec.js +24 -0
  28. package/src/components/IconBox/IconBox.scss +14 -0
  29. package/src/components/IconBox/IconBox.stories.js +13 -0
  30. package/src/components/IconBox/IconBox.vue +29 -0
  31. package/src/components/IconBox/__tests__/IconBox.spec.js +20 -0
  32. package/src/components/IconBox/index.js +3 -0
  33. package/src/components/Logos/OriginatorLogo/OriginatorLogo.stories.js +13 -0
  34. package/src/components/Logos/OriginatorLogo/OriginatorLogo.vue +31 -0
  35. package/src/components/Logos/OriginatorLogo/__tests__/OriginatorLogo.spec.js +32 -0
  36. package/src/components/Logos/OriginatorLogo/index.js +4 -0
  37. package/src/components/Logos/ProductLogo/ProductLogo.stories.js +13 -0
  38. package/src/components/Logos/ProductLogo/ProductLogo.vue +31 -0
  39. package/src/components/Logos/ProductLogo/__tests__/ProductLogo.spec.js +32 -0
  40. package/src/components/Logos/ProductLogo/index.js +4 -0
  41. package/src/components/Logos/index.js +2 -0
  42. package/src/components/MainFilter/__tests__/MainFilter.spec.js +23 -0
  43. package/src/components/ManagersList/__tests__/ManagersList.spec.js +27 -0
  44. package/src/components/Tabs/{Tabs.spec.js → __tests__/Tabs.spec.js} +1 -1
  45. package/src/main.js +8 -1
  46. package/src/components/MainFilter/MainFilter.spec.js +0 -43
package/package.json CHANGED
@@ -1,78 +1,78 @@
1
1
  {
2
- "name": "@farm-investimentos/front-mfe-components",
3
- "version": "2.2.7",
4
- "author": "farm investimentos",
5
- "private": false,
6
- "main": "./dist/front-mfe-components.common.js",
7
- "unpkg": "dist/front-mfe-components.umd.min.js",
8
- "jsdelivr": "dist/front-mfe-components.umd.min.js",
9
- "scripts": {
10
- "serve": "vue-cli-service serve",
11
- "build": "npm run build:components",
12
- "build:components": "vue-cli-service build --target lib --name front-mfe-components src/main.js",
13
- "lint": "vue-cli-service lint",
14
- "storybook": "start-storybook -p 6006",
15
- "build-storybook": "build-storybook",
16
- "test:unit": "jest --updateSnapshot",
17
- "test:coverage": "jest --updateSnapshot --coverage"
18
- },
19
- "files": [
20
- "dist/*",
21
- "src/*"
22
- ],
23
- "dependencies": {
24
- "@socheatsok78/storybook-addon-vuetify": "^0.1.8",
25
- "@vue/cli-service-global": "^4.5.13",
26
- "@vue/test-utils": "^1.3.0",
27
- "core-js": "^3.6.5",
28
- "sass": "~1.32.0",
29
- "sass-loader": "^10.2.0",
30
- "vue": "^2.6.11",
31
- "vuetify": "^2.5.7"
32
- },
33
- "devDependencies": {
34
- "@babel/core": "^7.14.8",
35
- "@storybook/addon-actions": "^6.3.6",
36
- "@storybook/addon-essentials": "^6.3.6",
37
- "@storybook/addon-links": "^6.3.6",
38
- "@storybook/vue": "^6.3.6",
39
- "@vue/cli-plugin-babel": "~4.5.0",
40
- "@vue/cli-plugin-eslint": "~4.5.0",
41
- "@vue/cli-plugin-unit-jest": "^4.5.15",
42
- "@vue/cli-service": "~4.5.0",
43
- "babel-eslint": "^10.1.0",
44
- "babel-loader": "^8.2.2",
45
- "eslint": "^6.7.2",
46
- "eslint-plugin-vue": "^6.2.2",
47
- "jest": "^25.5.4",
48
- "jsdoc": "^3.6.7",
49
- "vue-template-compiler": "^2.6.11",
50
- "webpack-cli": "^4.9.0"
51
- },
52
- "eslintConfig": {
53
- "root": true,
54
- "env": {
55
- "node": true
56
- },
57
- "extends": [
58
- "plugin:vue/essential",
59
- "eslint:recommended"
60
- ],
61
- "parserOptions": {
62
- "parser": "babel-eslint"
63
- },
64
- "rules": {}
65
- },
66
- "browserslist": [
67
- "> 1%",
68
- "last 2 versions",
69
- "not dead"
70
- ],
71
- "repository": {
72
- "type": "git",
73
- "url": "git://github.com/Farm-Investimentos/front-mfe-components.git"
74
- },
75
- "publishConfig": {
76
- "@farm-investimentos:registry": "https://registry.npmjs.org"
77
- }
2
+ "name": "@farm-investimentos/front-mfe-components",
3
+ "version": "2.4.2",
4
+ "author": "farm investimentos",
5
+ "private": false,
6
+ "main": "./dist/front-mfe-components.common.js",
7
+ "unpkg": "dist/front-mfe-components.umd.min.js",
8
+ "jsdelivr": "dist/front-mfe-components.umd.min.js",
9
+ "scripts": {
10
+ "serve": "vue-cli-service serve",
11
+ "build": "npm run build:components",
12
+ "build:components": "vue-cli-service build --target lib --name front-mfe-components src/main.js",
13
+ "lint": "vue-cli-service lint",
14
+ "storybook": "start-storybook -p 6006",
15
+ "build-storybook": "build-storybook",
16
+ "test:unit": "jest --updateSnapshot",
17
+ "test:coverage": "jest --updateSnapshot --coverage"
18
+ },
19
+ "files": [
20
+ "dist/*",
21
+ "src/*"
22
+ ],
23
+ "dependencies": {
24
+ "@socheatsok78/storybook-addon-vuetify": "^0.1.8",
25
+ "@vue/cli-service-global": "^4.5.13",
26
+ "@vue/test-utils": "^1.3.0",
27
+ "core-js": "^3.6.5",
28
+ "sass": "~1.32.0",
29
+ "sass-loader": "^10.2.0",
30
+ "vue": "^2.6.11",
31
+ "vuetify": "^2.5.7"
32
+ },
33
+ "devDependencies": {
34
+ "@babel/core": "^7.14.8",
35
+ "@storybook/addon-actions": "^6.3.6",
36
+ "@storybook/addon-essentials": "^6.3.6",
37
+ "@storybook/addon-links": "^6.3.6",
38
+ "@storybook/vue": "^6.3.6",
39
+ "@vue/cli-plugin-babel": "~4.5.0",
40
+ "@vue/cli-plugin-eslint": "~4.5.0",
41
+ "@vue/cli-plugin-unit-jest": "^4.5.15",
42
+ "@vue/cli-service": "~4.5.0",
43
+ "babel-eslint": "^10.1.0",
44
+ "babel-loader": "^8.2.2",
45
+ "eslint": "^6.7.2",
46
+ "eslint-plugin-vue": "^6.2.2",
47
+ "jest": "^25.5.4",
48
+ "jsdoc": "^3.6.7",
49
+ "vue-template-compiler": "^2.6.11",
50
+ "webpack-cli": "^4.9.0"
51
+ },
52
+ "eslintConfig": {
53
+ "root": true,
54
+ "env": {
55
+ "node": true
56
+ },
57
+ "extends": [
58
+ "plugin:vue/essential",
59
+ "eslint:recommended"
60
+ ],
61
+ "parserOptions": {
62
+ "parser": "babel-eslint"
63
+ },
64
+ "rules": {}
65
+ },
66
+ "browserslist": [
67
+ "> 1%",
68
+ "last 2 versions",
69
+ "not dead"
70
+ ],
71
+ "repository": {
72
+ "type": "git",
73
+ "url": "git://github.com/Farm-Investimentos/front-mfe-components.git"
74
+ },
75
+ "publishConfig": {
76
+ "@farm-investimentos:registry": "https://registry.npmjs.org"
77
+ }
78
78
  }
@@ -1,17 +1,17 @@
1
1
  <template>
2
- <v-alert dense outlined type="error">
3
- <v-row align="center">
4
- <v-col class="grow">
5
- {{ label }}
6
- </v-col>
7
- <v-col class="shrink">
8
- <v-btn color="secondary" class="ml-3" @click="$emit('onClick')">
9
- <v-icon>mdi-refresh</v-icon>
10
- Recarregar</v-btn
11
- >
12
- </v-col>
13
- </v-row>
14
- </v-alert>
2
+ <v-alert dense outlined type="error" class="farm-alert-reload">
3
+ <v-row align="center">
4
+ <v-col class="grow">
5
+ {{ label }}
6
+ </v-col>
7
+ <v-col class="shrink">
8
+ <v-btn color="secondary" class="ml-3" alt="Recarregar" @click="$emit('onClick')">
9
+ <v-icon class="v-icon__refresh">mdi-refresh</v-icon>
10
+ Recarregar</v-btn
11
+ >
12
+ </v-col>
13
+ </v-row>
14
+ </v-alert>
15
15
  </template>
16
16
  <script>
17
17
  import VBtn from 'vuetify/lib/components/VBtn';
@@ -20,28 +20,30 @@ import VAlert from 'vuetify/lib/components/VAlert';
20
20
  import { VRow, VCol } from 'vuetify/lib/components/VGrid';
21
21
 
22
22
  export default {
23
- name: 'AlertReload',
24
- components: {
25
- VBtn,
26
- VIcon,
27
- VAlert,
28
- VRow,
29
- VCol,
30
- },
31
-
32
- props: {
33
- label: {
34
- type: String,
35
- default: '',
36
- },
37
- },
23
+ name: 'farm-alert-reload',
24
+ components: {
25
+ VBtn,
26
+ VIcon,
27
+ VAlert,
28
+ VRow,
29
+ VCol,
30
+ },
31
+ props: {
32
+ /**
33
+ * Label
34
+ */
35
+ label: {
36
+ type: String,
37
+ default: '',
38
+ },
39
+ },
38
40
  };
39
41
  </script>
40
42
 
41
- <style lang="scss">
43
+ <style lang="scss" scoped>
42
44
  .v-btn {
43
- .v-icon {
44
- margin-right: 1rem;
45
- }
45
+ .v-icon.v-icon__refresh {
46
+ margin-right: 1rem;
47
+ }
46
48
  }
47
49
  </style>
@@ -0,0 +1,18 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import AlertReload from '../AlertReload';
3
+
4
+ describe('AlertReload component', () => {
5
+ let wrapper;
6
+
7
+ beforeEach(() => {
8
+ wrapper = shallowMount(AlertReload, {
9
+ propsData: {
10
+ managersString: 'a,b,c',
11
+ },
12
+ });
13
+ });
14
+
15
+ test('Created hook', () => {
16
+ expect(wrapper).toBeDefined();
17
+ });
18
+ });
@@ -0,0 +1,16 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import ExportButton from '../ExportButton';
3
+
4
+ describe('ExportButton component', () => {
5
+ let wrapper;
6
+ let component;
7
+
8
+ beforeEach(() => {
9
+ wrapper = shallowMount(ExportButton);
10
+ component = wrapper.vm;
11
+ });
12
+
13
+ test('Created hook', () => {
14
+ expect(wrapper).toBeDefined();
15
+ });
16
+ });
@@ -0,0 +1,16 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import ImportButton from '../ImportButton';
3
+
4
+ describe('ImportButton component', () => {
5
+ let wrapper;
6
+ let component;
7
+
8
+ beforeEach(() => {
9
+ wrapper = shallowMount(ImportButton);
10
+ component = wrapper.vm;
11
+ });
12
+
13
+ test('Created hook', () => {
14
+ expect(wrapper).toBeDefined();
15
+ });
16
+ });
@@ -0,0 +1,16 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import RemoveButton from '../RemoveButton';
3
+
4
+ describe('RemoveButton component', () => {
5
+ let wrapper;
6
+ let component;
7
+
8
+ beforeEach(() => {
9
+ wrapper = shallowMount(RemoveButton);
10
+ component = wrapper.vm;
11
+ });
12
+
13
+ test('Created hook', () => {
14
+ expect(wrapper).toBeDefined();
15
+ });
16
+ });
@@ -0,0 +1,14 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import ToggleButton from '../ToggleButton';
3
+
4
+ describe('ToggleButton component', () => {
5
+ let wrapper;
6
+
7
+ beforeEach(() => {
8
+ wrapper = shallowMount(ToggleButton);
9
+ });
10
+
11
+ test('Created hook', () => {
12
+ expect(wrapper).toBeDefined();
13
+ });
14
+ });
@@ -0,0 +1,46 @@
1
+ .card-context {
2
+ width: 100%;
3
+ padding: 1.5rem;
4
+ background: #ffffff;
5
+ box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.16);
6
+ border-radius: 5px;
7
+ }
8
+
9
+ .card-context-header {
10
+ width: 100%;
11
+ height: 40px;
12
+ display: flex;
13
+ align-items: center;
14
+ justify-content: space-between;
15
+ }
16
+
17
+ .card-context-content {
18
+ width: calc(100% - 56px);
19
+ height: 40px;
20
+ display: flex;
21
+ align-items: center;
22
+ }
23
+
24
+ .card-context-title {
25
+ color: #5c5c5c;
26
+ margin: 0;
27
+ font-size: 0.75rem;
28
+ }
29
+
30
+ .card-context-title.bold {
31
+ font-size: 0.875rem;
32
+ font-weight: bold;
33
+ color: #1c1c1c;
34
+ }
35
+
36
+ .card-context-body {
37
+ width: 100%;
38
+ padding-top: 1rem;
39
+ }
40
+
41
+ .card-context-loding-or-error {
42
+ width: 100%;
43
+ display: flex;
44
+ align-items: center;
45
+ justify-content: center;
46
+ }
@@ -0,0 +1,47 @@
1
+ import CardContext from './CardContext.vue';
2
+
3
+ export default {
4
+ title: 'Example/CardContext',
5
+ component: CardContext,
6
+ };
7
+
8
+ export const Primary = () => ({
9
+ components: { CardContext },
10
+ template: `
11
+ <CardContext icon="mdi-currency-usd" title="Titulo do Card">
12
+ <p>Conteúdo do Card</p>
13
+ </CardContext>
14
+ `,
15
+ });
16
+
17
+ export const Secondary = () => ({
18
+ components: { CardContext },
19
+ template: `
20
+ <CardContext icon="mdi-currency-usd" title="Titulo do Card" bold>
21
+ <p>Conteúdo do Card</p>
22
+ </CardContext>
23
+ `,
24
+ });
25
+
26
+ export const WithLoading = () => ({
27
+ components: { CardContext },
28
+ template: `
29
+ <CardContext icon="mdi-currency-usd" title="Titulo do Card" isLoading>
30
+ <p>Conteúdo do Card</p>
31
+ </CardContext>
32
+ `,
33
+ });
34
+
35
+ export const WithError = () => ({
36
+ components: { CardContext },
37
+ template: `
38
+ <CardContext icon="mdi-currency-usd" title="Titulo do Card" isError>
39
+ <p>Conteúdo do Card</p>
40
+ </CardContext>
41
+ `,
42
+ });
43
+
44
+ Primary.storyName = 'Básico';
45
+ Secondary.storyName = 'Título em Bold';
46
+ WithLoading.storyName = 'Com Loading';
47
+ WithError.storyName = 'Com Erro';
@@ -0,0 +1,96 @@
1
+ <template>
2
+ <div class="card-context">
3
+ <div class="card-context-header" v-if="isSuccess">
4
+ <IconBox :icon="icon" />
5
+ <div class="card-context-content">
6
+ <p :class="isBold">
7
+ {{ title }}
8
+ </p>
9
+ </div>
10
+ </div>
11
+ <div class="card-context-body" v-if="isSuccess">
12
+ <slot></slot>
13
+ </div>
14
+ <div class="card-context-loding-or-error" v-if="isLoading">
15
+ <Loader size="small" />
16
+ </div>
17
+ <div class="card-context-loding-or-error" v-if="isError">
18
+ <AlertReload :label="errorLabel" @onClick="$emit('onLoad')" />
19
+ </div>
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+ import Vue from 'vue';
25
+ import { Loader, AlertReload, IconBox } from '../../main.js';
26
+
27
+ export default Vue.extend({
28
+ name: 'farm-card-context',
29
+ components: {
30
+ IconBox,
31
+ AlertReload,
32
+ Loader,
33
+ },
34
+ props: {
35
+ /**
36
+ * Title
37
+ */
38
+ title: {
39
+ type: String,
40
+ require: true,
41
+ },
42
+ /**
43
+ * Set bold text
44
+ */
45
+ bold: {
46
+ type: Boolean,
47
+ default: false,
48
+ },
49
+ /**
50
+ * Icon (from Material Icons)
51
+ * Example: mdi-chart-bar
52
+ */
53
+ icon: {
54
+ type: String,
55
+ require: true,
56
+ },
57
+ /**
58
+ * Show loader
59
+ */
60
+ isLoading: {
61
+ type: Boolean,
62
+ default: false,
63
+ },
64
+ /**
65
+ * Show error alert
66
+ */
67
+ isError: {
68
+ type: Boolean,
69
+ default: false,
70
+ },
71
+ /**
72
+ * Label to be shown in error alert
73
+ */
74
+ errorLabel: {
75
+ type: String,
76
+ default: 'Ocorreu um erro',
77
+ },
78
+ },
79
+
80
+ computed: {
81
+ isBold() {
82
+ if (this.bold) {
83
+ return 'card-context-title bold';
84
+ }
85
+ return 'card-context-title';
86
+ },
87
+ isSuccess() {
88
+ return !this.isLoading && !this.isError;
89
+ },
90
+ },
91
+ });
92
+ </script>
93
+
94
+ <style lang="sass" scoped>
95
+ @import './CardContext.scss'
96
+ </style>
@@ -0,0 +1,20 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import CardContext from '../CardContext';
3
+
4
+ describe('CardContext component', () => {
5
+ let wrapper;
6
+
7
+ beforeEach(() => {
8
+ wrapper = shallowMount(CardContext);
9
+ });
10
+
11
+ test('Created hook', () => {
12
+ expect(wrapper).toBeDefined();
13
+ });
14
+
15
+ describe('mount component', () => {
16
+ it('renders correctly', () => {
17
+ expect(wrapper.element).toMatchSnapshot();
18
+ });
19
+ });
20
+ });
@@ -0,0 +1,3 @@
1
+ import CardContext from './CardContext';
2
+
3
+ export default CardContext;
@@ -21,7 +21,7 @@ export const Primary = () => ({
21
21
  sortable: true,
22
22
  value: 'approvedAmount',
23
23
  align: 'center',
24
- width: 160,
24
+ width: 320,
25
25
  },
26
26
  {
27
27
  text: 'Disponível',
@@ -7,17 +7,18 @@
7
7
  v-bind:class="[
8
8
  item.sortable ? 'sortable' : '',
9
9
  sortClick[$index].clicked ? 'active' : '',
10
- item.sortable && sortClick[$index].descending === 'DESC' ? 'DESC' : 'ASC',
10
+ item.sortable ? (sortClick[$index].descending === 'DESC' ? 'DESC' : 'ASC') : '',
11
11
  ]"
12
12
  v-bind:style="{
13
- textAlign: item.align,
13
+ textAlign: item.align ? item.align : '',
14
14
  width: thWidth(item),
15
+ minWidth: thWidth(item),
15
16
  }"
16
17
  @click="item.sortable ? clickSort(item.value, $index) : ''"
17
18
  @mouseover="changeShow($index)"
18
19
  @mouseout="changeHidden($index)"
19
20
  >
20
- <span class="header-text">
21
+ <span class="header-text" v-if="!isTHDataTableSelect(item)">
21
22
  {{ item.text }}
22
23
 
23
24
  <v-icon
@@ -111,8 +112,14 @@ export default Vue.extend({
111
112
  return false;
112
113
  },
113
114
  thWidth(item) {
115
+ if (this.isTHDataTableSelect(item)) {
116
+ return '64px';
117
+ }
114
118
  return item.width ? item.width + 'px' : 'auto';
115
119
  },
120
+ isTHDataTableSelect(item) {
121
+ return item.value === 'data-table-select';
122
+ },
116
123
  },
117
124
  created() {
118
125
  for (let i = 0; i < this.headers.length; i += 1) {
@@ -0,0 +1,89 @@
1
+ import { shallowMount } from '@vue/test-utils';
2
+ import DataTableHeader from '../DataTableHeader';
3
+
4
+ describe('DataTableHeader component', () => {
5
+ let wrapper;
6
+ let component;
7
+
8
+ beforeEach(() => {
9
+ wrapper = shallowMount(DataTableHeader, {
10
+ propsData: {
11
+ headers: [
12
+ {
13
+ value: 'A',
14
+ },
15
+ ],
16
+ sortClick: [
17
+ {
18
+ clicked: true,
19
+ show: true,
20
+ },
21
+ {
22
+ clicked: false,
23
+ show: false,
24
+ },
25
+ ],
26
+ selectedIndex: 0,
27
+ firstSelected: true,
28
+ },
29
+ });
30
+ component = wrapper.vm;
31
+ });
32
+
33
+ test('Created hook', () => {
34
+ expect(wrapper).toBeDefined();
35
+ });
36
+
37
+ describe('mount component', () => {
38
+ it('renders correctly', () => {
39
+ expect(wrapper.element).toMatchSnapshot();
40
+ });
41
+ });
42
+
43
+ describe('Methods', () => {
44
+ it('Should check if item is data-table-select column', () => {
45
+ expect(component.isTHDataTableSelect({ value: 'data-table-select' })).toBeTruthy();
46
+ expect(component.isTHDataTableSelect({ value: 'anything else' })).toBeFalsy();
47
+ });
48
+
49
+ it('Should get th width', () => {
50
+ expect(component.thWidth({ value: 'data-table-select' })).toEqual('64px');
51
+ expect(component.thWidth({ width: 24 })).toEqual('24px');
52
+ expect(component.thWidth({})).toEqual('auto');
53
+ });
54
+
55
+ it('Should remove clicked', () => {
56
+ component.removeClicked();
57
+ expect(component.sortClick[0].clicked).toBeFalsy();
58
+ expect(component.sortClick[0].show).toBeFalsy();
59
+ });
60
+
61
+ it('Should check first selected', () => {
62
+ expect(component.checkFirstSelected(999)).toBeFalsy();
63
+ expect(component.checkFirstSelected(0)).toBeTruthy();
64
+ });
65
+
66
+ it('Should emit event when clickSort', () => {
67
+ component.clickSort('A', 0);
68
+ expect(wrapper.emitted().onClickSort).toBeDefined();
69
+ });
70
+
71
+ it('Should get type sort', () => {
72
+ expect(component.getTypeSort(false)).toEqual('ASC');
73
+ expect(component.getTypeSort(true)).toEqual('DESC');
74
+ });
75
+
76
+ it('Should change show', async () => {
77
+ component.changeShow(0);
78
+ await new Promise(r => setTimeout(r, 20));
79
+ expect(component.sortClick[0].show).toBeTruthy();
80
+ });
81
+
82
+ it('Should change show', async () => {
83
+ component.changeHidden(0);
84
+ component.changeHidden(1);
85
+ await new Promise(r => setTimeout(r, 30));
86
+ expect(component.sortClick[1].show).toBeFalsy();
87
+ });
88
+ });
89
+ });