@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
|
@@ -5,6 +5,7 @@ export default {
|
|
|
5
5
|
title: 'Organisms/Containers/Tableau',
|
|
6
6
|
component: Tableau,
|
|
7
7
|
args: {
|
|
8
|
+
showBoutDirectorAssignment: true,
|
|
8
9
|
bouts: getDEWithBouts.pools[0].Bouts,
|
|
9
10
|
bracketSize: getDEWithBouts.pools[0].Bouts[0].RoundLabel,
|
|
10
11
|
hostingClubColors: getDEWithBouts.hostingClubColors
|
|
@@ -1,204 +1,247 @@
|
|
|
1
|
-
import { shallowMount } from '@vue/test-utils';
|
|
2
|
-
import { describe, expect, it } from 'vitest';
|
|
3
|
-
import getDEWithBouts42Fencers from '../../../../mocks/getDEBouts-42Fencers.js';
|
|
4
|
-
import getDEBoutsTableOf128 from '../../../../mocks/getDEBouts-TableOf128.js';
|
|
5
|
-
import getDEBoutsTableOf64 from '../../../../mocks/getDEBouts-TableOf64.js';
|
|
6
|
-
import BoutCard from '../../Cards/BoutCard/BoutCard.vue';
|
|
7
|
-
import TableauColumn from '../TableauColumn/TableauColumn.vue';
|
|
8
|
-
import Tableau from './Tableau.vue';
|
|
9
|
-
|
|
10
|
-
const bout = {
|
|
11
|
-
BoutId: 42,
|
|
12
|
-
DEBoutId: 1,
|
|
13
|
-
RoundLabel: 'Final',
|
|
14
|
-
Status: 'Scheduled',
|
|
15
|
-
Person1: { PersonId: 1, DisplayName: 'Fencer One' },
|
|
16
|
-
Person2: { PersonId: 2, DisplayName: 'Fencer Two' }
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const mountListView = () =>
|
|
20
|
-
shallowMount(Tableau, {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
boutCard.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
])
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import getDEWithBouts42Fencers from '../../../../mocks/getDEBouts-42Fencers.js';
|
|
4
|
+
import getDEBoutsTableOf128 from '../../../../mocks/getDEBouts-TableOf128.js';
|
|
5
|
+
import getDEBoutsTableOf64 from '../../../../mocks/getDEBouts-TableOf64.js';
|
|
6
|
+
import BoutCard from '../../Cards/BoutCard/BoutCard.vue';
|
|
7
|
+
import TableauColumn from '../TableauColumn/TableauColumn.vue';
|
|
8
|
+
import Tableau from './Tableau.vue';
|
|
9
|
+
|
|
10
|
+
const bout = {
|
|
11
|
+
BoutId: 42,
|
|
12
|
+
DEBoutId: 1,
|
|
13
|
+
RoundLabel: 'Final',
|
|
14
|
+
Status: 'Scheduled',
|
|
15
|
+
Person1: { PersonId: 1, DisplayName: 'Fencer One' },
|
|
16
|
+
Person2: { PersonId: 2, DisplayName: 'Fencer Two' }
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const mountListView = () =>
|
|
20
|
+
shallowMount(Tableau, {
|
|
21
|
+
global: { renderStubDefaultSlot: true },
|
|
22
|
+
props: {
|
|
23
|
+
bouts: [bout],
|
|
24
|
+
bracketSize: 'Final',
|
|
25
|
+
hostingClubColors: {},
|
|
26
|
+
listView: true,
|
|
27
|
+
showBoutDirectorAssignment: false
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
describe('Tableau list view', () => {
|
|
32
|
+
it('enables bout interaction and emits the full bout when starting', async () => {
|
|
33
|
+
const wrapper = mountListView();
|
|
34
|
+
const boutCard = wrapper.findComponent(BoutCard);
|
|
35
|
+
|
|
36
|
+
expect(boutCard.props('editMode')).toBe(true);
|
|
37
|
+
|
|
38
|
+
boutCard.vm.$emit('action:startBout', { BoutId: bout.BoutId });
|
|
39
|
+
await wrapper.vm.$nextTick();
|
|
40
|
+
|
|
41
|
+
expect(wrapper.emitted('action:directingBout')).toEqual([[bout]]);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('routes active bout resume through the directing event', async () => {
|
|
45
|
+
const activeBout = { ...bout, Status: 'Active' };
|
|
46
|
+
const wrapper = shallowMount(Tableau, {
|
|
47
|
+
global: { renderStubDefaultSlot: true },
|
|
48
|
+
props: {
|
|
49
|
+
bouts: [activeBout],
|
|
50
|
+
bracketSize: 'Final',
|
|
51
|
+
hostingClubColors: {},
|
|
52
|
+
listView: true
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
wrapper.findComponent(BoutCard).vm.$emit('action:resumeBout', { BoutId: activeBout.BoutId });
|
|
57
|
+
await wrapper.vm.$nextTick();
|
|
58
|
+
|
|
59
|
+
expect(wrapper.emitted('action:directingBout')).toEqual([[activeBout]]);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('bubbles the viewer suggestions to the top without removing other scheduled bouts', () => {
|
|
63
|
+
const viewerBout = { ...bout, BoutId: 43, DEBoutId: 2 };
|
|
64
|
+
const wrapper = shallowMount(Tableau, {
|
|
65
|
+
global: { renderStubDefaultSlot: true },
|
|
66
|
+
props: {
|
|
67
|
+
bouts: [bout, viewerBout],
|
|
68
|
+
bracketSize: 'Final',
|
|
69
|
+
hostingClubColors: {},
|
|
70
|
+
listView: true,
|
|
71
|
+
plannedDirectingStations: [
|
|
72
|
+
{
|
|
73
|
+
RingId: 7,
|
|
74
|
+
RingName: 'Ring 7',
|
|
75
|
+
Color: '#2563eb',
|
|
76
|
+
Director: { PersonId: 99, DisplayName: 'Viewer Director' }
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
plannedBoutAssignments: [{ DEBoutId: viewerBout.DEBoutId, RingId: 7 }],
|
|
80
|
+
viewerPersonId: '99'
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
expect(wrapper.vm.listSections[0]).toMatchObject({
|
|
85
|
+
key: 'suggested-for-viewer',
|
|
86
|
+
label: 'Suggested for You',
|
|
87
|
+
bouts: [viewerBout]
|
|
88
|
+
});
|
|
89
|
+
expect(wrapper.vm.listSections.flatMap(section => section.bouts)).toEqual([viewerBout, bout]);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
describe('Tableau bracket view', () => {
|
|
94
|
+
it('routes a scheduled tableau bout through the same directing event', async () => {
|
|
95
|
+
const wrapper = shallowMount(Tableau, {
|
|
96
|
+
global: { renderStubDefaultSlot: true },
|
|
97
|
+
props: {
|
|
98
|
+
bouts: [bout],
|
|
99
|
+
bracketSize: 'Final',
|
|
100
|
+
hostingClubColors: {},
|
|
101
|
+
listView: false
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
wrapper.findComponent(TableauColumn).vm.$emit('action:directingBout', bout);
|
|
106
|
+
await wrapper.vm.$nextTick();
|
|
107
|
+
|
|
108
|
+
expect(wrapper.emitted('action:directingBout')).toEqual([[bout]]);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('spaces each rendered round by its actual column depth', () => {
|
|
112
|
+
const wrapper = shallowMount(Tableau, {
|
|
113
|
+
global: { renderStubDefaultSlot: true },
|
|
114
|
+
props: {
|
|
115
|
+
bouts: [bout],
|
|
116
|
+
bracketSize: 'Table of 8',
|
|
117
|
+
hostingClubColors: {},
|
|
118
|
+
listView: false
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
expect(wrapper.vm.getRoundLayout(0)).toEqual({ gapPx: 16, padTopPx: 0 });
|
|
123
|
+
expect(wrapper.vm.getRoundLayout(1)).toEqual({ gapPx: 89, padTopPx: 36.5 });
|
|
124
|
+
expect(wrapper.vm.getRoundLayout(2)).toEqual({ gapPx: 235, padTopPx: 109.5 });
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
it('orders the current 42-fencer fixture through Table of 8 without a legacy quarterfinal', () => {
|
|
128
|
+
const wrapper = shallowMount(Tableau, {
|
|
129
|
+
global: { renderStubDefaultSlot: true },
|
|
130
|
+
props: {
|
|
131
|
+
bouts: getDEWithBouts42Fencers.pools[0].Bouts,
|
|
132
|
+
bracketSize: 'Table of 64',
|
|
133
|
+
hostingClubColors: getDEWithBouts42Fencers.hostingClubColors,
|
|
134
|
+
listView: false
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
expect(wrapper.vm.winnerRoundEntries.map(([roundName]) => roundName)).toEqual([
|
|
139
|
+
'Table of 64',
|
|
140
|
+
'Table of 32',
|
|
141
|
+
'Table of 16',
|
|
142
|
+
'Table of 8',
|
|
143
|
+
'Semifinal',
|
|
144
|
+
'Final'
|
|
145
|
+
]);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it('renders a current Table of 64 fixture with the expected bout count per round', () => {
|
|
149
|
+
const wrapper = shallowMount(Tableau, {
|
|
150
|
+
global: { renderStubDefaultSlot: true },
|
|
151
|
+
props: {
|
|
152
|
+
bouts: getDEBoutsTableOf64.pools[0].Bouts,
|
|
153
|
+
bracketSize: 'Table of 64',
|
|
154
|
+
hostingClubColors: getDEBoutsTableOf64.hostingClubColors,
|
|
155
|
+
listView: false
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
expect(wrapper.vm.winnerRoundEntries.map(([roundName, roundBouts]) => [roundName, roundBouts.length])).toEqual([
|
|
160
|
+
['Table of 64', 32],
|
|
161
|
+
['Table of 32', 16],
|
|
162
|
+
['Table of 16', 8],
|
|
163
|
+
['Table of 8', 4],
|
|
164
|
+
['Semifinal', 2],
|
|
165
|
+
['Final', 1]
|
|
166
|
+
]);
|
|
167
|
+
|
|
168
|
+
const openingRound = wrapper.vm.winnerRoundEntries[0][1];
|
|
169
|
+
const openingFencers = openingRound.flatMap(roundBout => [roundBout.Person1, roundBout.Person2]);
|
|
170
|
+
const assignedFencerIds = new Set(openingFencers.filter(fencer => fencer.PersonId).map(fencer => fencer.PersonId));
|
|
171
|
+
|
|
172
|
+
expect(assignedFencerIds.size).toBe(61);
|
|
173
|
+
expect(openingFencers.filter(fencer => fencer.DisplayName === 'BYE')).toHaveLength(3);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
it('renders a complete Table of 128 fixture for large-bracket layout coverage', () => {
|
|
177
|
+
const wrapper = shallowMount(Tableau, {
|
|
178
|
+
global: { renderStubDefaultSlot: true },
|
|
179
|
+
props: {
|
|
180
|
+
bouts: getDEBoutsTableOf128.pools[0].Bouts,
|
|
181
|
+
bracketSize: 'Table of 128',
|
|
182
|
+
hostingClubColors: getDEBoutsTableOf128.hostingClubColors,
|
|
183
|
+
listView: false
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
expect(wrapper.vm.winnerRoundEntries.map(([roundName, roundBouts]) => [roundName, roundBouts.length])).toEqual([
|
|
188
|
+
['Table of 128', 64],
|
|
189
|
+
['Table of 64', 32],
|
|
190
|
+
['Table of 32', 16],
|
|
191
|
+
['Table of 16', 8],
|
|
192
|
+
['Table of 8', 4],
|
|
193
|
+
['Semifinal', 2],
|
|
194
|
+
['Final', 1]
|
|
195
|
+
]);
|
|
196
|
+
|
|
197
|
+
const allBouts = getDEBoutsTableOf128.pools[0].Bouts;
|
|
198
|
+
const openingFencers = wrapper.vm.winnerRoundEntries[0][1].flatMap(roundBout => [
|
|
199
|
+
roundBout.Person1,
|
|
200
|
+
roundBout.Person2
|
|
201
|
+
]);
|
|
202
|
+
const assignedFencerIds = new Set(openingFencers.filter(fencer => fencer.PersonId).map(fencer => fencer.PersonId));
|
|
203
|
+
const boutIds = new Set(allBouts.map(roundBout => roundBout.DEBoutId));
|
|
204
|
+
const missingNextBouts = allBouts.filter(
|
|
205
|
+
roundBout => roundBout.DENextBoutId && !boutIds.has(roundBout.DENextBoutId)
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
expect(allBouts).toHaveLength(127);
|
|
209
|
+
expect(assignedFencerIds.size).toBe(67);
|
|
210
|
+
expect(openingFencers.filter(fencer => fencer.DisplayName === 'BYE')).toHaveLength(61);
|
|
211
|
+
expect(missingNextBouts).toEqual([]);
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
describe('Tableau completed bout disclosure', () => {
|
|
216
|
+
it('keeps completed bouts out of the main list and routes corrections to editing', async () => {
|
|
217
|
+
const completedBout = { ...bout, BoutId: 43, DEBoutId: 2, Status: 'Completed' };
|
|
218
|
+
const wrapper = mountListView();
|
|
219
|
+
await wrapper.setProps({ bouts: [bout, completedBout] });
|
|
220
|
+
expect(wrapper.vm.listSections.flatMap(section => section.bouts)).toEqual([bout]);
|
|
221
|
+
const disclosure = wrapper.get('details');
|
|
222
|
+
expect(disclosure.attributes('open')).toBeUndefined();
|
|
223
|
+
expect(disclosure.get('summary').text()).toBe('Completed bouts (1)');
|
|
224
|
+
disclosure.findComponent(BoutCard).vm.$emit('action:editBout', { BoutId: 43 });
|
|
225
|
+
await wrapper.vm.$nextTick();
|
|
226
|
+
expect(wrapper.emitted('action:editBout')).toEqual([[completedBout]]);
|
|
227
|
+
expect(wrapper.emitted('action:directingBout')).toBeUndefined();
|
|
228
|
+
await wrapper.setProps({ bouts: [bout] });
|
|
229
|
+
expect(wrapper.find('details').exists()).toBe(false);
|
|
230
|
+
wrapper.unmount();
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
describe('Tableau directing list eligibility', () => {
|
|
235
|
+
it('omits future and BYE pairings from the directing list', async () => {
|
|
236
|
+
const wrapper = mountListView();
|
|
237
|
+
await wrapper.setProps({
|
|
238
|
+
bouts: [
|
|
239
|
+
bout,
|
|
240
|
+
{ ...bout, BoutId: 43, Person2: null },
|
|
241
|
+
{ ...bout, BoutId: 44, Person1: { PersonId: 0, DisplayName: 'BYE' } }
|
|
242
|
+
]
|
|
243
|
+
});
|
|
244
|
+
expect(wrapper.vm.listSections.flatMap(section => section.bouts)).toEqual([bout]);
|
|
245
|
+
wrapper.unmount();
|
|
246
|
+
});
|
|
247
|
+
});
|