@dcrackel/hematournamentui 1.0.714 → 1.0.716

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 (25) hide show
  1. package/README.md +2 -0
  2. package/dist/HemaTournamentUI-lib.es.js +4367 -3850
  3. package/dist/HemaTournamentUI-lib.umd.js +27 -27
  4. package/dist/hematournamentui-tailwind.css +267 -9
  5. package/package.json +1 -1
  6. package/src/index.js +45 -43
  7. package/src/stories/Organisms/Cards/RingBoutCard/RingBoutCard.vue +158 -0
  8. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.stories.js +10 -0
  9. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.vue +140 -80
  10. package/src/stories/Organisms/Cards/WaitlistFencerCard/WaitlistFencerCard.test.js +94 -0
  11. package/src/stories/Organisms/Cards/WaitlistFencerCard/WaitlistFencerCard.vue +180 -153
  12. package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.test.js +19 -3
  13. package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.vue +59 -22
  14. package/src/stories/Templates/EventManagement/Bracket/Bracket.stories.js +13 -0
  15. package/src/stories/Templates/EventManagement/Bracket/Bracket.test.js +26 -0
  16. package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +6 -2
  17. package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.stories.js +35 -3
  18. package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.test.js +73 -0
  19. package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.vue +417 -403
  20. package/src/stories/Templates/EventManagement/RingBoard/README.md +29 -0
  21. package/src/stories/Templates/EventManagement/RingBoard/RingBoard.stories.js +118 -0
  22. package/src/stories/Templates/EventManagement/RingBoard/RingBoard.test.js +208 -0
  23. package/src/stories/Templates/EventManagement/RingBoard/RingBoard.vue +170 -0
  24. package/src/stories/Util/ringBoard.js +103 -0
  25. package/src/stories/Util/waitlistAttendance.js +8 -0
@@ -0,0 +1,73 @@
1
+ import { mount } from '@vue/test-utils';
2
+ import { describe, expect, it } from 'vitest';
3
+ import EventAttendance from './EventAttendance.vue';
4
+ import WaitlistFencerCard from '../../../Organisms/Cards/WaitlistFencerCard/WaitlistFencerCard.vue';
5
+ import ButtonBar from '../../../Molecules/Buttons/ButtonBar/ButtonBar.vue';
6
+
7
+ const createPerson = (id, status) => ({
8
+ PersonId: id,
9
+ Status: status,
10
+ CheckedIn: false,
11
+ WaitlistPosition: id,
12
+ Person: {
13
+ DisplayName: `Fencer ${id}`,
14
+ Weaver: { Required: true, Scope: 'Tournament', Signed: true }
15
+ }
16
+ });
17
+
18
+ const mountAttendance = personsInTournament =>
19
+ mount(EventAttendance, {
20
+ props: { event: { Status: 'preparation' }, personsInTournament },
21
+ shallow: true,
22
+ global: { stubs: { WaitlistFencerCard: false, ButtonBar: false, BaseButton: false, BaseText: false } }
23
+ });
24
+
25
+ describe('Waitlist attendance intent', () => {
26
+ it('keeps check-in separate from promotion into a no-show spot', async () => {
27
+ const absent = createPerson(1, 'Absent');
28
+ const waiting = createPerson(2, 'Waitlist');
29
+ const wrapper = mountAttendance([absent, waiting]);
30
+ const card = wrapper.getComponent(WaitlistFencerCard);
31
+
32
+ await card.getComponent(ButtonBar).findAll('section')[1].trigger('click');
33
+ const checkedIn = wrapper.emitted('update:waitlist-check-in')[0][0];
34
+ expect(checkedIn).toEqual({ ...waiting, CheckedIn: true });
35
+ expect(wrapper.emitted('update:person')).toBeUndefined();
36
+ expect(wrapper.emitted('move:waitlist-to-active')).toBeUndefined();
37
+
38
+ await wrapper.setProps({ personsInTournament: [absent, checkedIn] });
39
+ expect(wrapper.text()).toContain('1 waiting · 1 checked in');
40
+ expect(wrapper.getComponent(WaitlistFencerCard).text()).toContain('Next checked in');
41
+ const promote = card.findAll('button').find(button => button.text() === 'Move to Active');
42
+ await promote.trigger('click');
43
+ expect(wrapper.emitted('move:waitlist-to-active')[0][0]).toEqual(checkedIn);
44
+ expect(waiting.Status).toBe('Waitlist');
45
+
46
+ await wrapper.setProps({ personsInTournament: [absent, { ...checkedIn, Status: 'Present' }] });
47
+ expect(wrapper.findComponent(WaitlistFencerCard).exists()).toBe(false);
48
+ expect(wrapper.findAllComponents({ name: 'FencerCard' })).toHaveLength(2);
49
+ wrapper.unmount();
50
+ });
51
+
52
+ it('confirms a waitlisted waiver through the existing modal without changing roster status', async () => {
53
+ const waiting = createPerson(2, 'Waitlist');
54
+ waiting.Person.Weaver.Signed = false;
55
+ const wrapper = mountAttendance([waiting]);
56
+ const sign = wrapper
57
+ .getComponent(WaitlistFencerCard)
58
+ .findAll('button')
59
+ .find(button => button.text() === 'Sign Waiver');
60
+
61
+ await sign.trigger('click');
62
+ const modal = wrapper.getComponent({ name: 'BaseModal' });
63
+ expect(modal.props('show')).toBe(true);
64
+ modal.vm.$emit('submitModal');
65
+ await wrapper.vm.$nextTick();
66
+ expect(wrapper.emitted('weaver:sign')[0][0]).toEqual(waiting);
67
+ expect(wrapper.emitted('weaver:sign')[0][0].Person).not.toBe(waiting.Person);
68
+ expect(waiting.Person.Weaver.Signed).toBe(false);
69
+ expect(wrapper.emitted('update:waitlist-check-in')).toBeUndefined();
70
+ expect(modal.props('show')).toBe(false);
71
+ wrapper.unmount();
72
+ });
73
+ });