@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,106 +1,106 @@
|
|
|
1
|
-
import { afterEach, expect, it } from 'vitest';
|
|
2
|
-
import { shallowMount } from '@vue/test-utils';
|
|
3
|
-
import EventCard from './EventCard.vue';
|
|
4
|
-
|
|
5
|
-
const wrappers = [];
|
|
6
|
-
afterEach(() => wrappers.splice(0).forEach(wrapper => wrapper.unmount()));
|
|
7
|
-
const nativeFunction = 'function link() { [native code] }';
|
|
8
|
-
|
|
9
|
-
function rule(RuleName, RuleValue) {
|
|
10
|
-
return { Rules: { RuleName }, RuleValue };
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function mountCard(overrides = {}) {
|
|
14
|
-
const wrapper = shallowMount(EventCard, {
|
|
15
|
-
props: {
|
|
16
|
-
event: {
|
|
17
|
-
EventName: 'Example Event',
|
|
18
|
-
Date: '2026-10-17',
|
|
19
|
-
StartTime: '12:00',
|
|
20
|
-
Present: '8',
|
|
21
|
-
Absent: '0',
|
|
22
|
-
EventRules: [],
|
|
23
|
-
...overrides
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
global: { stubs: { BaseText: { props: ['text'], template: '<span>{{ text }}</span>' } } }
|
|
27
|
-
});
|
|
28
|
-
wrappers.push(wrapper);
|
|
29
|
-
return wrapper;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
it.each([
|
|
33
|
-
[32, '32'],
|
|
34
|
-
['32', '32'],
|
|
35
|
-
[0, 'Unlimited'],
|
|
36
|
-
['0', 'Unlimited'],
|
|
37
|
-
[null, 'Unlimited'],
|
|
38
|
-
['', 'Unlimited'],
|
|
39
|
-
[nativeFunction, 'Not set']
|
|
40
|
-
])('renders the fencer limit %j as %s', (value, expected) => {
|
|
41
|
-
const wrapper = mountCard({ EventRules: [rule('CutOffNumber', value)] });
|
|
42
|
-
expect(wrapper.vm.getMaxFencers).toBe(expected);
|
|
43
|
-
expect(wrapper.text()).not.toContain('[native code]');
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it('handles missing rules without crashing or inventing an elimination format', () => {
|
|
47
|
-
const wrapper = mountCard({ EventRules: undefined });
|
|
48
|
-
expect(wrapper.vm.getMaxFencers).toBe('Unlimited');
|
|
49
|
-
expect(wrapper.vm.eventSummary).toBe('Event settings not available');
|
|
50
|
-
expect(wrapper.vm.getCombinedNumberOfFencers).toBe('8 / Unlimited');
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('keeps the phase, time, point and fencer summaries for nested and flat API rules', () => {
|
|
54
|
-
const EventRules = [
|
|
55
|
-
rule('PoolTime', '90'),
|
|
56
|
-
rule('DETime', '180'),
|
|
57
|
-
rule('PoolMaxPoints', '7'),
|
|
58
|
-
rule('DEMaxPoints', '12'),
|
|
59
|
-
rule('DEType', 'single'),
|
|
60
|
-
rule('DE3rdFenceOff', true),
|
|
61
|
-
rule('CutOffNumber', '32')
|
|
62
|
-
];
|
|
63
|
-
for (const event of [
|
|
64
|
-
{ EventRules },
|
|
65
|
-
{
|
|
66
|
-
EventRules: undefined,
|
|
67
|
-
rules: EventRules.map(item => ({ RuleName: item.Rules.RuleName, RuleValue: item.RuleValue }))
|
|
68
|
-
}
|
|
69
|
-
]) {
|
|
70
|
-
const wrapper = mountCard(event);
|
|
71
|
-
expect(wrapper.vm.eventSummary).toBe('Pools -> Single Elim -> 3rd Place Fence off');
|
|
72
|
-
expect(wrapper.vm.getMaxPoolPoints).toBe('7');
|
|
73
|
-
expect(wrapper.vm.getMaxDEPoints).toBe('12');
|
|
74
|
-
expect(wrapper.vm.getCombinedNumberOfFencers).toBe('8 / 32');
|
|
75
|
-
expect(wrapper.text().match(/1:30/g)).toHaveLength(2);
|
|
76
|
-
expect(wrapper.text().match(/3:00/g)).toHaveLength(2);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it('renders pass-based pools and double elimination correctly', () => {
|
|
81
|
-
const wrapper = mountCard({
|
|
82
|
-
EventRules: [
|
|
83
|
-
rule('PoolNumOfPasses', '5'),
|
|
84
|
-
rule('DENumOfPasses', '7'),
|
|
85
|
-
rule('DEType', 'double'),
|
|
86
|
-
rule('DE3rdFenceOff', 'false')
|
|
87
|
-
]
|
|
88
|
-
});
|
|
89
|
-
expect(wrapper.vm.eventSummary).toBe('Pools -> Double Elim -> Tie for 3rd Place');
|
|
90
|
-
expect(wrapper.vm.getPoolBoutTimeOrPasses).toBe('5');
|
|
91
|
-
expect(wrapper.vm.getDEBoutTimeOrPasses).toBe('7');
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('marks corrupted stored values as unset instead of displaying function text or guessing a format', () => {
|
|
95
|
-
const wrapper = mountCard({
|
|
96
|
-
EventRules: ['CutOffNumber', 'PoolTime', 'PoolMaxPoints', 'DETime', 'DEMaxPoints', 'DEType'].map(name =>
|
|
97
|
-
rule(name, nativeFunction)
|
|
98
|
-
)
|
|
99
|
-
});
|
|
100
|
-
expect(wrapper.text()).not.toContain('[native code]');
|
|
101
|
-
expect(wrapper.text()).not.toContain('NaN');
|
|
102
|
-
expect(wrapper.vm.eventSummary).toContain('DE format not set');
|
|
103
|
-
expect(wrapper.vm.getMaxFencers).toBe('Not set');
|
|
104
|
-
expect(wrapper.vm.getPoolBoutTimeOrPasses).toBe('Not set');
|
|
105
|
-
expect(wrapper.vm.getMaxDEPoints).toBe('Not set');
|
|
106
|
-
});
|
|
1
|
+
import { afterEach, expect, it } from 'vitest';
|
|
2
|
+
import { shallowMount } from '@vue/test-utils';
|
|
3
|
+
import EventCard from './EventCard.vue';
|
|
4
|
+
|
|
5
|
+
const wrappers = [];
|
|
6
|
+
afterEach(() => wrappers.splice(0).forEach(wrapper => wrapper.unmount()));
|
|
7
|
+
const nativeFunction = 'function link() { [native code] }';
|
|
8
|
+
|
|
9
|
+
function rule(RuleName, RuleValue) {
|
|
10
|
+
return { Rules: { RuleName }, RuleValue };
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function mountCard(overrides = {}) {
|
|
14
|
+
const wrapper = shallowMount(EventCard, {
|
|
15
|
+
props: {
|
|
16
|
+
event: {
|
|
17
|
+
EventName: 'Example Event',
|
|
18
|
+
Date: '2026-10-17',
|
|
19
|
+
StartTime: '12:00',
|
|
20
|
+
Present: '8',
|
|
21
|
+
Absent: '0',
|
|
22
|
+
EventRules: [],
|
|
23
|
+
...overrides
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
global: { stubs: { BaseText: { props: ['text'], template: '<span>{{ text }}</span>' } } }
|
|
27
|
+
});
|
|
28
|
+
wrappers.push(wrapper);
|
|
29
|
+
return wrapper;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
it.each([
|
|
33
|
+
[32, '32'],
|
|
34
|
+
['32', '32'],
|
|
35
|
+
[0, 'Unlimited'],
|
|
36
|
+
['0', 'Unlimited'],
|
|
37
|
+
[null, 'Unlimited'],
|
|
38
|
+
['', 'Unlimited'],
|
|
39
|
+
[nativeFunction, 'Not set']
|
|
40
|
+
])('renders the fencer limit %j as %s', (value, expected) => {
|
|
41
|
+
const wrapper = mountCard({ EventRules: [rule('CutOffNumber', value)] });
|
|
42
|
+
expect(wrapper.vm.getMaxFencers).toBe(expected);
|
|
43
|
+
expect(wrapper.text()).not.toContain('[native code]');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('handles missing rules without crashing or inventing an elimination format', () => {
|
|
47
|
+
const wrapper = mountCard({ EventRules: undefined });
|
|
48
|
+
expect(wrapper.vm.getMaxFencers).toBe('Unlimited');
|
|
49
|
+
expect(wrapper.vm.eventSummary).toBe('Event settings not available');
|
|
50
|
+
expect(wrapper.vm.getCombinedNumberOfFencers).toBe('8 / Unlimited');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('keeps the phase, time, point and fencer summaries for nested and flat API rules', () => {
|
|
54
|
+
const EventRules = [
|
|
55
|
+
rule('PoolTime', '90'),
|
|
56
|
+
rule('DETime', '180'),
|
|
57
|
+
rule('PoolMaxPoints', '7'),
|
|
58
|
+
rule('DEMaxPoints', '12'),
|
|
59
|
+
rule('DEType', 'single'),
|
|
60
|
+
rule('DE3rdFenceOff', true),
|
|
61
|
+
rule('CutOffNumber', '32')
|
|
62
|
+
];
|
|
63
|
+
for (const event of [
|
|
64
|
+
{ EventRules },
|
|
65
|
+
{
|
|
66
|
+
EventRules: undefined,
|
|
67
|
+
rules: EventRules.map(item => ({ RuleName: item.Rules.RuleName, RuleValue: item.RuleValue }))
|
|
68
|
+
}
|
|
69
|
+
]) {
|
|
70
|
+
const wrapper = mountCard(event);
|
|
71
|
+
expect(wrapper.vm.eventSummary).toBe('Pools -> Single Elim -> 3rd Place Fence off');
|
|
72
|
+
expect(wrapper.vm.getMaxPoolPoints).toBe('7');
|
|
73
|
+
expect(wrapper.vm.getMaxDEPoints).toBe('12');
|
|
74
|
+
expect(wrapper.vm.getCombinedNumberOfFencers).toBe('8 / 32');
|
|
75
|
+
expect(wrapper.text().match(/1:30/g)).toHaveLength(2);
|
|
76
|
+
expect(wrapper.text().match(/3:00/g)).toHaveLength(2);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('renders pass-based pools and double elimination correctly', () => {
|
|
81
|
+
const wrapper = mountCard({
|
|
82
|
+
EventRules: [
|
|
83
|
+
rule('PoolNumOfPasses', '5'),
|
|
84
|
+
rule('DENumOfPasses', '7'),
|
|
85
|
+
rule('DEType', 'double'),
|
|
86
|
+
rule('DE3rdFenceOff', 'false')
|
|
87
|
+
]
|
|
88
|
+
});
|
|
89
|
+
expect(wrapper.vm.eventSummary).toBe('Pools -> Double Elim -> Tie for 3rd Place');
|
|
90
|
+
expect(wrapper.vm.getPoolBoutTimeOrPasses).toBe('5');
|
|
91
|
+
expect(wrapper.vm.getDEBoutTimeOrPasses).toBe('7');
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it('marks corrupted stored values as unset instead of displaying function text or guessing a format', () => {
|
|
95
|
+
const wrapper = mountCard({
|
|
96
|
+
EventRules: ['CutOffNumber', 'PoolTime', 'PoolMaxPoints', 'DETime', 'DEMaxPoints', 'DEType'].map(name =>
|
|
97
|
+
rule(name, nativeFunction)
|
|
98
|
+
)
|
|
99
|
+
});
|
|
100
|
+
expect(wrapper.text()).not.toContain('[native code]');
|
|
101
|
+
expect(wrapper.text()).not.toContain('NaN');
|
|
102
|
+
expect(wrapper.vm.eventSummary).toContain('DE format not set');
|
|
103
|
+
expect(wrapper.vm.getMaxFencers).toBe('Not set');
|
|
104
|
+
expect(wrapper.vm.getPoolBoutTimeOrPasses).toBe('Not set');
|
|
105
|
+
expect(wrapper.vm.getMaxDEPoints).toBe('Not set');
|
|
106
|
+
});
|