@eturnity/eturnity_reusable_components 8.34.0-EPDM-13618.2 → 8.34.0-EPDM-16204.1

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.
@@ -1,62 +0,0 @@
1
- import defaultDropdownProps from './defaultProps'
2
- import ProgressBar from './index.vue'
3
- import theme from '@/assets/theme'
4
-
5
- export default {
6
- title: 'ProgressBar',
7
- component: ProgressBar,
8
- tags: ['autodocs'],
9
- argTypes: {
10
- fillProgress: {
11
- description: 'Precentage of progress bar filled in with color',
12
- },
13
- labelText: {
14
- description: 'Label text above the progress bar',
15
- },
16
- appTheme: {
17
- description: 'App color theme',
18
- control: 'select',
19
- options: ['light', 'dark'],
20
- },
21
- },
22
- }
23
-
24
- // To use:
25
- // import ProgressBar from "@eturnity/eturnity_reusable_components/src/components/progressBar"
26
- // <ProgressBar
27
- // :fill-progress="50"
28
- // :label-text="some label text"
29
- // />
30
-
31
- const Template = (args) => {
32
- return {
33
- components: { ProgressBar },
34
- setup() {
35
- return { args }
36
- },
37
- provide: {
38
- theme,
39
- },
40
- template: `
41
- <ProgressBar v-bind="args"/>
42
- `,
43
- }
44
- }
45
-
46
- export const Default = Template.bind({})
47
- Default.args = {
48
- ...defaultDropdownProps,
49
- }
50
-
51
- export const ProgressBarLabelText = Template.bind({})
52
- ProgressBarLabelText.args = {
53
- ...defaultDropdownProps,
54
- labelText: 'Progress Bar Label Text',
55
- }
56
-
57
- export const ProgressBarLabelTextAppThemeDark = Template.bind({})
58
- ProgressBarLabelTextAppThemeDark.args = {
59
- ...defaultDropdownProps,
60
- labelText: 'Progress Bar Label Text',
61
- appTheme: 'dark',
62
- }
@@ -1,5 +0,0 @@
1
- const defaultProps = {
2
- fillProgress: '65',
3
- }
4
-
5
- export default defaultProps
@@ -1,52 +0,0 @@
1
- import { mount } from '@vue/test-utils'
2
- import RCProgressBar from '@/components/progressBar'
3
- import defaultProps from './defaultProps'
4
- import theme from '@/assets/theme'
5
-
6
- jest.mock('@/components/icon/iconCache.mjs', () => ({
7
- // need to mock this due to how jest handles import.meta
8
- fetchIcon: jest.fn(() => Promise.resolve('mocked-icon-url.svg')),
9
- }))
10
-
11
- describe('progressBar/index.vue', () => {
12
- it('progress bar is rendered with correct props', async () => {
13
- const labelText = 'test_label_text'
14
-
15
- const wrapper = mount(RCProgressBar, {
16
- props: { ...defaultProps, labelText },
17
- global: {
18
- provide: {
19
- theme,
20
- },
21
- },
22
- })
23
-
24
- const progressBarProgress = wrapper.find(
25
- '[data-test-id="progress_bar_progress"]'
26
- )
27
- const progressBarLabel = wrapper.find('[data-test-id="progress_bar_label"]')
28
-
29
- expect(wrapper.vm.fillProgress).toBe(defaultProps.fillProgress)
30
- expect(progressBarProgress.exists()).toBe(true)
31
- expect(progressBarLabel.exists()).toBe(true)
32
-
33
- expect(progressBarLabel.text()).toContain(labelText)
34
- })
35
-
36
- it('progress bar progress changes', async () => {
37
- const wrapper = mount(RCProgressBar, {
38
- props: {},
39
- global: {
40
- provide: {
41
- theme,
42
- },
43
- },
44
- })
45
-
46
- expect(wrapper.vm.fillProgress).toBe(0)
47
-
48
- await wrapper.setProps({ fillProgress: defaultProps.fillProgress })
49
-
50
- expect(wrapper.vm.fillProgress).toBe(defaultProps.fillProgress)
51
- })
52
- })