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