@dcrackel/hematournamentui 1.0.712 → 1.0.713
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.
- package/.prettierignore +7 -7
- package/.storybook/main.js +3 -1
- package/README.md +30 -0
- package/package.json +96 -96
- package/prettier.config.js +16 -16
- package/src/main.js +1 -1
- package/src/mocks/getDEBouts-TableOf128.js +37 -37
- package/src/mocks/getDEBouts-TableOf64.js +35 -35
- package/src/stories/Atoms/Input/BaseInput.test.js +97 -97
- package/src/stories/Atoms/Input/BaseInput.vue +149 -149
- package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.stories.js +23 -23
- package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.vue +35 -35
- package/src/stories/Molecules/Indicators/RegistrationStatus/RegistrationStatus.vue +30 -30
- package/src/stories/Molecules/Menus/HoverActions/HoverActions.test.js +138 -0
- package/src/stories/Molecules/Menus/HoverActions/HoverActions.vue +212 -0
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.stories.js +6 -0
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.test.js +18 -18
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +1 -1
- package/src/stories/Organisms/Cards/BoutCard/BoutCard.vue +5 -1
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardActive/BoutCardActive.vue +19 -10
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardInactive/BoutCardInactive.vue +11 -7
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.stories.js +33 -33
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.test.js +45 -45
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.vue +103 -103
- package/src/stories/Organisms/Cards/Director/DirectorCard.test.js +82 -0
- package/src/stories/Organisms/Cards/Director/DirectorCard.vue +32 -51
- package/src/stories/Organisms/Cards/EditBout/EditBout.test.js +51 -51
- package/src/stories/Organisms/Cards/EventCard/EventCard.test.js +106 -106
- package/src/stories/Organisms/Cards/FencerCard/FencerCard.vue +298 -298
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.stories.js +77 -60
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.test.js +144 -143
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.vue +289 -256
- package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.stories.js +69 -69
- package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.vue +80 -80
- package/src/stories/Organisms/Cards/WaitlistFencerCard/WaitlistFencerCard.vue +153 -153
- package/src/stories/Organisms/ComplexInputs/DropDown/DropDownMenu.vue +4 -0
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.stories.js +31 -31
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.test.js +109 -109
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue +192 -192
- package/src/stories/Organisms/Containers/Tableau/Tableau.stories.js +1 -0
- package/src/stories/Organisms/Containers/Tableau/Tableau.test.js +247 -204
- package/src/stories/Organisms/Containers/Tableau/Tableau.vue +89 -15
- package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.test.js +29 -29
- package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.vue +46 -46
- package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.test.js +21 -21
- package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.vue +39 -39
- package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.js +145 -145
- package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.test.js +64 -64
- package/src/stories/Organisms/Containers/Tableau/plannedAssignments.js +36 -57
- package/src/stories/Organisms/Containers/Tableau/plannedAssignments.test.js +101 -65
- package/src/stories/Organisms/Containers/TableauColumn/TableauColumn.vue +14 -1
- package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.stories.js +52 -52
- package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.vue +10 -3
- package/src/stories/Organisms/Wizards/EditEventWizard/DirectElimination/DirectElimination.vue +226 -226
- package/src/stories/Organisms/Wizards/EditEventWizard/DirectEliminationPromotion/DirectEliminationPromotion.vue +204 -204
- package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.stories.js +137 -137
- package/src/stories/Organisms/Wizards/EditEventWizard/EventCustomization/EventCustomization.vue +172 -172
- package/src/stories/Organisms/Wizards/EditEventWizard/PoolConfiguration/PoolConfiguration.vue +216 -216
- package/src/stories/Organisms/Wizards/EditEventWizard/PriceFields.test.js +79 -79
- package/src/stories/Organisms/Wizards/EditEventWizard/RuleSerialization.test.js +29 -29
- package/src/stories/Organisms/Wizards/EditEventWizard/WeaponSelection.test.js +138 -0
- package/src/stories/Templates/EventManagement/Bracket/Bracket.stories.js +123 -12
- package/src/stories/Templates/EventManagement/Bracket/Bracket.test.js +178 -166
- package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +35 -7
- package/src/stories/Templates/EventManagement/Bracket/BracketDirectorAssignment.test.js +242 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketMobile.test.js +131 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketPlannedSuggestions.js +42 -39
- package/src/stories/Templates/EventManagement/Bracket/BracketStories.test.js +80 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryAssignments.js +93 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryAssignments.test.js +152 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.js +39 -39
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.test.js +79 -79
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.stories.js +93 -93
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.vue +91 -91
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.test.js +121 -121
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.stories.js +9 -2
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.vue +5 -4
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.stories.js +81 -81
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.test.js +39 -39
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.vue +101 -101
- package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.stories.js +71 -71
- package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.vue +86 -86
- package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.stories.js +86 -86
- package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.vue +247 -247
- package/src/stories/Templates/PersonManagement/Basic/BasicEdit.vue +170 -170
- package/src/stories/Templates/PersonManagement/PersonManagement.stories.js +156 -156
- package/src/stories/Templates/PersonManagement/PersonManagement.test.js +329 -329
- package/src/stories/Templates/PersonManagement/PersonManagement.vue +329 -329
- package/src/stories/Templates/PersonManagement/PersonManagementDraft.js +42 -42
- package/src/stories/Templates/TournamentManagement/TournamentManagement.stories.js +84 -84
- package/src/stories/Templates/TournamentManagement/TournamentManagement.test.js +114 -114
- package/src/stories/Templates/TournamentManagement/TournamentManagement.vue +363 -363
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.stories.js +116 -116
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.vue +307 -307
- package/src/stories/Util/Validations/PersonManagementValidations.js +45 -45
- package/src/stories/Util/Validations/PriceValidation.js +6 -6
- package/src/stories/Util/boutDirectorAssignment.js +46 -0
- package/src/stories/Util/registrationStatus.js +11 -11
- package/src/stories/Util/tabs.js +19 -47
|
@@ -1,60 +1,77 @@
|
|
|
1
|
-
import getDEWithBouts from '../../../../mocks/getDEWithBouts.js';
|
|
2
|
-
import TableauBoutCard from './TableauBoutCard.vue';
|
|
3
|
-
|
|
4
|
-
const baseBout = getDEWithBouts.pools[0].Bouts[2];
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Organisms/Cards/TableauBoutCard',
|
|
8
|
-
component: TableauBoutCard,
|
|
9
|
-
tags: ['autodocs'],
|
|
10
|
-
args: {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
1
|
+
import getDEWithBouts from '../../../../mocks/getDEWithBouts.js';
|
|
2
|
+
import TableauBoutCard from './TableauBoutCard.vue';
|
|
3
|
+
|
|
4
|
+
const baseBout = getDEWithBouts.pools[0].Bouts[2];
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Organisms/Cards/TableauBoutCard',
|
|
8
|
+
component: TableauBoutCard,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
args: {
|
|
11
|
+
showBoutDirectorAssignment: true,
|
|
12
|
+
bout: baseBout,
|
|
13
|
+
hostingClubColors: getDEWithBouts.hostingClubColors,
|
|
14
|
+
roundName: baseBout.RoundLabel,
|
|
15
|
+
bracketSize: 'Table of 8'
|
|
16
|
+
},
|
|
17
|
+
argTypes: {
|
|
18
|
+
showBoutDirectorAssignment: { control: 'boolean' },
|
|
19
|
+
plannedDirectorName: { control: 'text', description: 'Assigned director shown above the assignment action' },
|
|
20
|
+
plannedDirectorColor: {
|
|
21
|
+
control: 'color',
|
|
22
|
+
description: 'Director name color matching the planned ring and connectors'
|
|
23
|
+
},
|
|
24
|
+
bout: {
|
|
25
|
+
control: 'object',
|
|
26
|
+
description: 'Bout containing both fencers, scores, status, and bracket links'
|
|
27
|
+
},
|
|
28
|
+
hostingClubColors: {
|
|
29
|
+
control: 'object',
|
|
30
|
+
description: 'Hosting-club colors used for the seed strips'
|
|
31
|
+
},
|
|
32
|
+
roundName: {
|
|
33
|
+
control: 'text',
|
|
34
|
+
description: 'Name of the displayed round'
|
|
35
|
+
},
|
|
36
|
+
bracketSize: {
|
|
37
|
+
control: 'text',
|
|
38
|
+
description: 'Name of the opening bracket round'
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const Default = {};
|
|
44
|
+
|
|
45
|
+
export const HoverActions = {
|
|
46
|
+
args: {
|
|
47
|
+
bout: { ...baseBout, Status: 'Scheduled', RoundLabel: 'Semifinal' },
|
|
48
|
+
roundName: 'Semifinal',
|
|
49
|
+
showBoutDirectorAssignment: true,
|
|
50
|
+
plannedDirectorName: 'Dave Smith',
|
|
51
|
+
plannedDirectorColor: '#059669'
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const Active = {
|
|
56
|
+
args: {
|
|
57
|
+
bout: {
|
|
58
|
+
...baseBout,
|
|
59
|
+
Status: 'Active',
|
|
60
|
+
RingName: 'Ring 3',
|
|
61
|
+
TimeLeft: 95,
|
|
62
|
+
TimerStatus: 'running'
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const Completed = {
|
|
68
|
+
args: {
|
|
69
|
+
bout: { ...baseBout, Status: 'Completed' }
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const Bye = {
|
|
74
|
+
args: {
|
|
75
|
+
bout: getDEWithBouts.pools[0].Bouts[0]
|
|
76
|
+
}
|
|
77
|
+
};
|
|
@@ -1,143 +1,144 @@
|
|
|
1
|
-
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
|
-
import { describe, expect, it, vi } from 'vitest';
|
|
3
|
-
import TableauFencerCard from '../TableauFencerCard/TableauFencerCard.vue';
|
|
4
|
-
import TableauBoutCard from './TableauBoutCard.vue';
|
|
5
|
-
|
|
6
|
-
const createBout = status => ({
|
|
7
|
-
BoutId: 42,
|
|
8
|
-
DEBoutId: 7,
|
|
9
|
-
Status: status,
|
|
10
|
-
Score1: 4,
|
|
11
|
-
Score2: 3,
|
|
12
|
-
Person1: { PersonId: 1, DisplayName: 'Fencer One', EventPersons: [] },
|
|
13
|
-
Person2: { PersonId: 2, DisplayName: 'Fencer Two', EventPersons: [] }
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const mountCard = bout =>
|
|
17
|
-
shallowMount(TableauBoutCard, {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
expect(button.
|
|
40
|
-
expect(button.
|
|
41
|
-
expect(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
expect(wrapper.emitted('action:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
expect(wrapper.emitted('action:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
expect(wrapper.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
expect(
|
|
99
|
-
expect(boutButton.classes()).toContain('hover:ring-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
expect(wrapper.find('[data-testid="active-ring"]
|
|
112
|
-
expect(wrapper.find('[data-testid="active-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
expect(wrapper.find('[data-testid="active-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
expect(
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
});
|
|
1
|
+
import { mount, shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
3
|
+
import TableauFencerCard from '../TableauFencerCard/TableauFencerCard.vue';
|
|
4
|
+
import TableauBoutCard from './TableauBoutCard.vue';
|
|
5
|
+
|
|
6
|
+
const createBout = status => ({
|
|
7
|
+
BoutId: 42,
|
|
8
|
+
DEBoutId: 7,
|
|
9
|
+
Status: status,
|
|
10
|
+
Score1: 4,
|
|
11
|
+
Score2: 3,
|
|
12
|
+
Person1: { PersonId: 1, DisplayName: 'Fencer One', EventPersons: [] },
|
|
13
|
+
Person2: { PersonId: 2, DisplayName: 'Fencer Two', EventPersons: [] }
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const mountCard = bout =>
|
|
17
|
+
shallowMount(TableauBoutCard, {
|
|
18
|
+
global: { renderStubDefaultSlot: true },
|
|
19
|
+
props: {
|
|
20
|
+
bout,
|
|
21
|
+
hostingClubColors: {},
|
|
22
|
+
roundName: 'Final',
|
|
23
|
+
bracketSize: 'Final'
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
describe('TableauBoutCard selection', () => {
|
|
28
|
+
it('keeps the fencer layout outside the native selection button', () => {
|
|
29
|
+
const wrapper = mount(TableauBoutCard, {
|
|
30
|
+
props: {
|
|
31
|
+
bout: createBout('Scheduled'),
|
|
32
|
+
hostingClubColors: {},
|
|
33
|
+
roundName: 'Final',
|
|
34
|
+
bracketSize: 'Final'
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
const button = wrapper.find('[data-testid="tableau-bout"]');
|
|
38
|
+
|
|
39
|
+
expect(button.element.tagName).toBe('BUTTON');
|
|
40
|
+
expect(button.attributes('aria-label')).toBe('Fencer One versus Fencer Two');
|
|
41
|
+
expect(button.find('div, section').exists()).toBe(false);
|
|
42
|
+
expect(wrapper.findAllComponents(TableauFencerCard)).toHaveLength(2);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('emits directing intent for a scheduled bout', async () => {
|
|
46
|
+
const bout = createBout('Scheduled');
|
|
47
|
+
const wrapper = mountCard(bout);
|
|
48
|
+
|
|
49
|
+
await wrapper.find('[data-testid="tableau-bout"]').trigger('click');
|
|
50
|
+
|
|
51
|
+
expect(wrapper.emitted('action:directingBout')).toEqual([[bout]]);
|
|
52
|
+
expect(wrapper.emitted('action:editBout')).toBeUndefined();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('does not draw planned-assignment color over the fencer card', () => {
|
|
56
|
+
const wrapper = mountCard(createBout('Scheduled'));
|
|
57
|
+
|
|
58
|
+
expect(wrapper.find('[data-testid="planned-assignment-indicator"]').exists()).toBe(false);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it('emits editing intent for a completed bout', async () => {
|
|
62
|
+
const bout = createBout('Completed');
|
|
63
|
+
const wrapper = mountCard(bout);
|
|
64
|
+
|
|
65
|
+
await wrapper.find('[data-testid="tableau-bout"]').trigger('click');
|
|
66
|
+
|
|
67
|
+
expect(wrapper.emitted('action:editBout')).toEqual([[bout]]);
|
|
68
|
+
expect(wrapper.emitted('action:directingBout')).toBeUndefined();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('emits directing intent for an active bout', async () => {
|
|
72
|
+
const bout = createBout('Active');
|
|
73
|
+
const wrapper = mountCard(bout);
|
|
74
|
+
|
|
75
|
+
await wrapper.find('[data-testid="tableau-bout"]').trigger('click');
|
|
76
|
+
|
|
77
|
+
expect(wrapper.emitted('action:directingBout')).toEqual([[bout]]);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('does not emit directing intent for a BYE bout', async () => {
|
|
81
|
+
const bout = {
|
|
82
|
+
...createBout('Scheduled'),
|
|
83
|
+
Person2: { PersonId: 0, DisplayName: 'BYE', EventPersons: [] }
|
|
84
|
+
};
|
|
85
|
+
const wrapper = mountCard(bout);
|
|
86
|
+
|
|
87
|
+
await wrapper.find('[data-testid="tableau-bout"]').trigger('click');
|
|
88
|
+
|
|
89
|
+
expect(wrapper.emitted('action:directingBout')).toBeUndefined();
|
|
90
|
+
expect(wrapper.find('[data-testid="tableau-bout"]').attributes('disabled')).toBeDefined();
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('rounds the outside corners and highlights the whole bout on hover', () => {
|
|
94
|
+
const wrapper = mountCard(createBout('Scheduled'));
|
|
95
|
+
const fencerRows = wrapper.findAllComponents(TableauFencerCard);
|
|
96
|
+
const boutButton = wrapper.find('[data-testid="tableau-bout"]');
|
|
97
|
+
|
|
98
|
+
expect(fencerRows.map(row => row.props('corners'))).toEqual(['top', 'bottom']);
|
|
99
|
+
expect(boutButton.classes()).toContain('hover:ring-bright');
|
|
100
|
+
expect(boutButton.classes()).toContain('hover:ring-2');
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('shows the assigned ring and time for an active bout', () => {
|
|
104
|
+
const wrapper = mountCard({
|
|
105
|
+
...createBout('Active'),
|
|
106
|
+
RingName: 'Ring 3',
|
|
107
|
+
TimeLeft: 95,
|
|
108
|
+
TimerStatus: 'stopped'
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
expect(wrapper.find('[data-testid="active-ring"]').exists()).toBe(true);
|
|
112
|
+
expect(wrapper.find('[data-testid="active-ring"] base-text-stub').attributes('text')).toBe('Ring 3');
|
|
113
|
+
expect(wrapper.find('[data-testid="active-time"] base-text-stub').attributes('text')).toBe('1:35');
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('hides active chrome after its ring and timer display fields are cleared', () => {
|
|
117
|
+
const wrapper = mountCard({
|
|
118
|
+
...createBout('Active'),
|
|
119
|
+
RingName: '',
|
|
120
|
+
TimeLeft: 0,
|
|
121
|
+
TimerStatus: 'stopped'
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
expect(wrapper.find('[data-testid="active-ring"]').exists()).toBe(false);
|
|
125
|
+
expect(wrapper.find('[data-testid="active-time"]').exists()).toBe(false);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('ticks the presentation timer without mutating the bout prop', async () => {
|
|
129
|
+
vi.useFakeTimers();
|
|
130
|
+
const bout = { ...createBout('Active'), TimeLeft: 90, TimerStatus: 'running' };
|
|
131
|
+
const wrapper = mountCard(bout);
|
|
132
|
+
|
|
133
|
+
try {
|
|
134
|
+
vi.advanceTimersByTime(1000);
|
|
135
|
+
await wrapper.vm.$nextTick();
|
|
136
|
+
|
|
137
|
+
expect(wrapper.vm.displayTime).toBe('1:29');
|
|
138
|
+
expect(bout.TimeLeft).toBe(90);
|
|
139
|
+
} finally {
|
|
140
|
+
wrapper.unmount();
|
|
141
|
+
vi.useRealTimers();
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
});
|