From 3c70f9a3bce0203b6f2783e0b827ddc7e32e351a Mon Sep 17 00:00:00 2001 From: goose-life <32566441+goose-life@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:19:42 +0200 Subject: [PATCH] add more tests --- tests/xml.js | 576 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 576 insertions(+) diff --git a/tests/xml.js b/tests/xml.js index 69fadc9..4519e7c 100644 --- a/tests/xml.js +++ b/tests/xml.js @@ -1080,6 +1080,257 @@ describe('fixTables', () => { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

No.

+
+

Security plan

+
+

Check box

+
+

1.

+
+

The floor plan of the proposed site or area.

+
+

Yes

+
+

No

+
+

2.

+
+

The access point (entry and exit).

+
+

Yes

+
+

No

+
+

3.

+
+

The entry/ exit point to be manned at all times.

+
+

Yes

+
+

No

+
+

4.

+
+

Patrons to be searched at point of arrival and departure.

+
+

Yes

+
+

No

+
+

5.

+
+

Storage facilities for licensed firearms to be provided.

+
+

Yes

+
+

No

+
+

6.

+
+

The point of sale to be cordoned off (indicated on the floor plan submitted).

+
+

Yes

+
+

No

+
+

7.

+
+

The restricted part for consumption of liquor to be cordoned off (to be indicated on the floor plan submitted).

+
+

Yes

+
+

No

+
+

8.

+
+

Parking to be provided.

+
+

Yes

+
+

No

+
+

9.

+
+

Ablution facilities for males and females to be provided.

+
+

Yes

+
+

No

+
+

+

+

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

1. Details of licensed outlet or premises

+
+

(a) Name of outlet:

+
+

(b) Trade name/s (if any):

+
+

(c) Registration number:

+
+

(d) Name of the metropolitan municipality/district municipality or local municipality where the licensed premises are situated:

+
+

(e) Physical business address of applicant:

+
+

2. Personal details of the applicant

+
+

(a) Names and surname:

+
+

(b) Designation of applicant:

+
+

(c) Contact details:

+
+

Cell: __________________________ Tel: __________________________ Fax: __________________________ Email: _________________________________

+
+

(Please attach certified copies of the documents requested in terms of regulation 25(3) to this form)

+

1. During the past 12 months, has the applicant, or any person holding an interest in the applicant, become disqualified from holding this liquor licence, as contemplated in section 40 of the Act?

+
+

Yes

+
+

No

+
+

2. If the answer to the above question is in the affirmative, please provide details of any decision taken by the relevant provincial licensing authority in terms of section 40 of the Act

+
+

3. Has the applicant or any of its owners, directors or subsidiaries been indicted or charged with any criminal offence, excluding traffic offences, during the past 12 months?

+
+

Yes

+
+

No

+
+

+

+

4. Has the applicant or any of its subsidiaries been a party to a law suit during the past 12 months?

+
+

If yes, provide details: __________________________

+
@@ -1636,10 +1887,335 @@ describe('fixTables', () => {

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

No.

+
+

Security plan

+
+

Check box

+
+

1.

+
+

The floor plan of the proposed site or area.

+
+

Yes

+
+

No

+
+

2.

+
+

The access point (entry and exit).

+
+

Yes

+
+

No

+
+

3.

+
+

The entry/ exit point to be manned at all times.

+
+

Yes

+
+

No

+
+

4.

+
+

Patrons to be searched at point of arrival and departure.

+
+

Yes

+
+

No

+
+

5.

+
+

Storage facilities for licensed firearms to be provided.

+
+

Yes

+
+

No

+
+

6.

+
+

The point of sale to be cordoned off (indicated on the floor plan submitted).

+
+

Yes

+
+

No

+
+

7.

+
+

The restricted part for consumption of liquor to be cordoned off (to be indicated on the floor plan submitted).

+
+

Yes

+
+

No

+
+

8.

+
+

Parking to be provided.

+
+

Yes

+
+

No

+
+

9.

+
+

Ablution facilities for males and females to be provided.

+
+

Yes

+
+

No

+
+

+

+

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

1. Details of licensed outlet or premises

+
+

(a) Name of outlet:

+
+

(b) Trade name/s (if any):

+
+

(c) Registration number:

+
+

(d) Name of the metropolitan municipality/district municipality or local municipality where the licensed premises are situated:

+
+

(e) Physical business address of applicant:

+
+

2. Personal details of the applicant

+
+

(a) Names and surname:

+
+

(b) Designation of applicant:

+
+

(c) Contact details:

+
+

Cell: __________________________ Tel: __________________________ Fax: __________________________ Email: _________________________________

+
+

(Please attach certified copies of the documents requested in terms of regulation 25(3) to this form)

+

1. During the past 12 months, has the applicant, or any person holding an interest in the applicant, become disqualified from holding this liquor licence, as contemplated in section 40 of the Act?

+
+

Yes

+
+

No

+
+

2. If the answer to the above question is in the affirmative, please provide details of any decision taken by the relevant provincial licensing authority in terms of section 40 of the Act

+
+

3. Has the applicant or any of its owners, directors or subsidiaries been indicted or charged with any criminal offence, excluding traffic offences, during the past 12 months?

+
+

Yes

+
+

No

+
+

+

+

4. Has the applicant or any of its subsidiaries been a party to a law suit during the past 12 months?

+
+

If yes, provide details: __________________________

+
`); }); + it('should throw an error when there are overlapping spans', () => { + const xml = ` + + + + + 1. + Heading + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Notice of intention to apply for a liquor licence for the undermentioned premises and proof of service

+

Name of premises

+

_____________________________________________________________

+
+

Full name

+
+

Surname

+
+

I.D. Number

+
+

Full address

+
+

Signature

+
+

+

+

+

+

+

+

+

+

+

+

+

+

+

+
+
+ +
+
`; + const doc = new DOMParser().parseFromString(xml, "text/xml"); + try { + fixTables([doc.documentElement]); + } catch (e) { + expect(e).to.equal("Cannot parse overlapping spans in table with eId att_13__table_1"); + } + }); });