@aquera/nile-elements 1.5.5 → 1.5.6

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 (216) hide show
  1. package/README.md +4 -0
  2. package/dist/index.cjs.js +1 -1
  3. package/dist/index.esm.js +1 -1
  4. package/dist/index.js +465 -238
  5. package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js +1 -1
  6. package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js.map +1 -1
  7. package/dist/nile-auto-complete/nile-auto-complete.css.esm.js +13 -2
  8. package/dist/nile-button/nile-button.cjs.js +1 -1
  9. package/dist/nile-button/nile-button.cjs.js.map +1 -1
  10. package/dist/nile-button/nile-button.css.cjs.js +1 -1
  11. package/dist/nile-button/nile-button.css.cjs.js.map +1 -1
  12. package/dist/nile-button/nile-button.css.esm.js +89 -33
  13. package/dist/nile-button/nile-button.esm.js +2 -2
  14. package/dist/nile-calendar/nile-calendar.cjs.js +1 -1
  15. package/dist/nile-calendar/nile-calendar.cjs.js.map +1 -1
  16. package/dist/nile-calendar/nile-calendar.css.cjs.js +1 -1
  17. package/dist/nile-calendar/nile-calendar.css.cjs.js.map +1 -1
  18. package/dist/nile-calendar/nile-calendar.css.esm.js +59 -2
  19. package/dist/nile-calendar/nile-calendar.esm.js +16 -10
  20. package/dist/nile-checkbox/nile-checkbox.css.cjs.js +1 -1
  21. package/dist/nile-checkbox/nile-checkbox.css.cjs.js.map +1 -1
  22. package/dist/nile-checkbox/nile-checkbox.css.esm.js +4 -5
  23. package/dist/nile-chip/nile-chip.css.cjs.js +1 -1
  24. package/dist/nile-chip/nile-chip.css.cjs.js.map +1 -1
  25. package/dist/nile-chip/nile-chip.css.esm.js +37 -23
  26. package/dist/nile-code-editor/nile-code-editor.cjs.js +1 -1
  27. package/dist/nile-code-editor/nile-code-editor.cjs.js.map +1 -1
  28. package/dist/nile-code-editor/nile-code-editor.css.cjs.js +1 -1
  29. package/dist/nile-code-editor/nile-code-editor.css.cjs.js.map +1 -1
  30. package/dist/nile-code-editor/nile-code-editor.css.esm.js +7 -6
  31. package/dist/nile-code-editor/nile-code-editor.esm.js +1 -1
  32. package/dist/nile-date-picker/nile-date-picker.cjs.js +1 -1
  33. package/dist/nile-date-picker/nile-date-picker.cjs.js.map +1 -1
  34. package/dist/nile-date-picker/nile-date-picker.esm.js +4 -4
  35. package/dist/nile-dropdown/nile-dropdown.cjs.js +1 -1
  36. package/dist/nile-dropdown/nile-dropdown.cjs.js.map +1 -1
  37. package/dist/nile-dropdown/nile-dropdown.esm.js +1 -1
  38. package/dist/nile-file-upload/utils/file-validation.util.cjs.js +2 -2
  39. package/dist/nile-file-upload/utils/file-validation.util.cjs.js.map +1 -1
  40. package/dist/nile-file-upload/utils/file-validation.util.esm.js +1 -1
  41. package/dist/nile-filter-chip/nile-filter-chip.cjs.js +1 -1
  42. package/dist/nile-filter-chip/nile-filter-chip.cjs.js.map +1 -1
  43. package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js +1 -1
  44. package/dist/nile-filter-chip/nile-filter-chip.css.cjs.js.map +1 -1
  45. package/dist/nile-filter-chip/nile-filter-chip.css.esm.js +24 -2
  46. package/dist/nile-filter-chip/nile-filter-chip.esm.js +2 -2
  47. package/dist/nile-inline-edit/nile-inline-edit.cjs.js +1 -1
  48. package/dist/nile-inline-edit/nile-inline-edit.cjs.js.map +1 -1
  49. package/dist/nile-inline-edit/nile-inline-edit.css.cjs.js +1 -1
  50. package/dist/nile-inline-edit/nile-inline-edit.css.cjs.js.map +1 -1
  51. package/dist/nile-inline-edit/nile-inline-edit.css.esm.js +15 -6
  52. package/dist/nile-inline-edit/nile-inline-edit.esm.js +2 -2
  53. package/dist/nile-input/nile-input.css.cjs.js +1 -1
  54. package/dist/nile-input/nile-input.css.cjs.js.map +1 -1
  55. package/dist/nile-input/nile-input.css.esm.js +4 -4
  56. package/dist/nile-link/nile-link.cjs.js +1 -1
  57. package/dist/nile-link/nile-link.cjs.js.map +1 -1
  58. package/dist/nile-link/nile-link.css.cjs.js +1 -1
  59. package/dist/nile-link/nile-link.css.cjs.js.map +1 -1
  60. package/dist/nile-link/nile-link.css.esm.js +3 -4
  61. package/dist/nile-link/nile-link.esm.js +2 -2
  62. package/dist/nile-qr-code/index.cjs.js +2 -0
  63. package/dist/nile-qr-code/index.cjs.js.map +1 -0
  64. package/dist/nile-qr-code/index.esm.js +1 -0
  65. package/dist/nile-qr-code/nile-qr-code-utils.cjs.js +2 -0
  66. package/dist/nile-qr-code/nile-qr-code-utils.cjs.js.map +1 -0
  67. package/dist/nile-qr-code/nile-qr-code-utils.esm.js +1 -0
  68. package/dist/nile-qr-code/nile-qr-code.cjs.js +2 -0
  69. package/dist/nile-qr-code/nile-qr-code.cjs.js.map +1 -0
  70. package/dist/nile-qr-code/nile-qr-code.css.cjs.js +2 -0
  71. package/dist/nile-qr-code/nile-qr-code.css.cjs.js.map +1 -0
  72. package/dist/nile-qr-code/nile-qr-code.css.esm.js +12 -0
  73. package/dist/nile-qr-code/nile-qr-code.esm.js +9 -0
  74. package/dist/nile-radio/nile-radio.css.cjs.js +1 -1
  75. package/dist/nile-radio/nile-radio.css.cjs.js.map +1 -1
  76. package/dist/nile-radio/nile-radio.css.esm.js +1 -1
  77. package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js +1 -1
  78. package/dist/nile-rich-text-editor/nile-rich-text-editor.cjs.js.map +1 -1
  79. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js +1 -1
  80. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.cjs.js.map +1 -1
  81. package/dist/nile-rich-text-editor/nile-rich-text-editor.css.esm.js +25 -6
  82. package/dist/nile-rich-text-editor/nile-rich-text-editor.esm.js +1 -1
  83. package/dist/nile-rich-text-editor/nile-rte-select.cjs.js +1 -1
  84. package/dist/nile-rich-text-editor/nile-rte-select.cjs.js.map +1 -1
  85. package/dist/nile-rich-text-editor/nile-rte-select.esm.js +4 -3
  86. package/dist/nile-select/nile-select.css.cjs.js +1 -1
  87. package/dist/nile-select/nile-select.css.cjs.js.map +1 -1
  88. package/dist/nile-select/nile-select.css.esm.js +7 -4
  89. package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js +1 -1
  90. package/dist/nile-slide-toggle/nile-slide-toggle.css.cjs.js.map +1 -1
  91. package/dist/nile-slide-toggle/nile-slide-toggle.css.esm.js +5 -1
  92. package/dist/nile-textarea/nile-textarea.css.cjs.js +1 -1
  93. package/dist/nile-textarea/nile-textarea.css.cjs.js.map +1 -1
  94. package/dist/nile-textarea/nile-textarea.css.esm.js +10 -5
  95. package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js +1 -1
  96. package/dist/nile-virtual-select/nile-virtual-select.css.cjs.js.map +1 -1
  97. package/dist/nile-virtual-select/nile-virtual-select.css.esm.js +5 -3
  98. package/dist/src/index.d.ts +1 -0
  99. package/dist/src/index.js +1 -0
  100. package/dist/src/index.js.map +1 -1
  101. package/dist/src/nile-auto-complete/nile-auto-complete.css.js +11 -0
  102. package/dist/src/nile-auto-complete/nile-auto-complete.css.js.map +1 -1
  103. package/dist/src/nile-button/nile-button.css.js +89 -33
  104. package/dist/src/nile-button/nile-button.css.js.map +1 -1
  105. package/dist/src/nile-button/nile-button.js +5 -5
  106. package/dist/src/nile-button/nile-button.js.map +1 -1
  107. package/dist/src/nile-calendar/nile-calendar.css.js +57 -0
  108. package/dist/src/nile-calendar/nile-calendar.css.js.map +1 -1
  109. package/dist/src/nile-calendar/nile-calendar.d.ts +1 -0
  110. package/dist/src/nile-calendar/nile-calendar.js +24 -6
  111. package/dist/src/nile-calendar/nile-calendar.js.map +1 -1
  112. package/dist/src/nile-checkbox/nile-checkbox.css.js +4 -5
  113. package/dist/src/nile-checkbox/nile-checkbox.css.js.map +1 -1
  114. package/dist/src/nile-chip/nile-chip.css.js +35 -21
  115. package/dist/src/nile-chip/nile-chip.css.js.map +1 -1
  116. package/dist/src/nile-code-editor/nile-code-editor.css.js +7 -6
  117. package/dist/src/nile-code-editor/nile-code-editor.css.js.map +1 -1
  118. package/dist/src/nile-code-editor/nile-code-editor.d.ts +1 -1
  119. package/dist/src/nile-code-editor/nile-code-editor.js +7 -1
  120. package/dist/src/nile-code-editor/nile-code-editor.js.map +1 -1
  121. package/dist/src/nile-date-picker/nile-date-picker.d.ts +3 -0
  122. package/dist/src/nile-date-picker/nile-date-picker.js +22 -2
  123. package/dist/src/nile-date-picker/nile-date-picker.js.map +1 -1
  124. package/dist/src/nile-dropdown/nile-dropdown.d.ts +1 -0
  125. package/dist/src/nile-dropdown/nile-dropdown.js +11 -0
  126. package/dist/src/nile-dropdown/nile-dropdown.js.map +1 -1
  127. package/dist/src/nile-file-upload/utils/file-validation.util.js +11 -6
  128. package/dist/src/nile-file-upload/utils/file-validation.util.js.map +1 -1
  129. package/dist/src/nile-filter-chip/nile-filter-chip.css.js +22 -0
  130. package/dist/src/nile-filter-chip/nile-filter-chip.css.js.map +1 -1
  131. package/dist/src/nile-filter-chip/nile-filter-chip.d.ts +1 -0
  132. package/dist/src/nile-filter-chip/nile-filter-chip.js +6 -0
  133. package/dist/src/nile-filter-chip/nile-filter-chip.js.map +1 -1
  134. package/dist/src/nile-inline-edit/nile-inline-edit.css.js +15 -6
  135. package/dist/src/nile-inline-edit/nile-inline-edit.css.js.map +1 -1
  136. package/dist/src/nile-inline-edit/nile-inline-edit.d.ts +2 -0
  137. package/dist/src/nile-inline-edit/nile-inline-edit.js +7 -0
  138. package/dist/src/nile-inline-edit/nile-inline-edit.js.map +1 -1
  139. package/dist/src/nile-input/nile-input.css.js +4 -4
  140. package/dist/src/nile-input/nile-input.css.js.map +1 -1
  141. package/dist/src/nile-link/nile-link.css.js +1 -2
  142. package/dist/src/nile-link/nile-link.css.js.map +1 -1
  143. package/dist/src/nile-link/nile-link.js +1 -0
  144. package/dist/src/nile-link/nile-link.js.map +1 -1
  145. package/dist/src/nile-qr-code/index.d.ts +1 -0
  146. package/dist/src/nile-qr-code/index.js +2 -0
  147. package/dist/src/nile-qr-code/index.js.map +1 -0
  148. package/dist/src/nile-qr-code/nile-qr-code-utils.d.ts +15 -0
  149. package/dist/src/nile-qr-code/nile-qr-code-utils.js +678 -0
  150. package/dist/src/nile-qr-code/nile-qr-code-utils.js.map +1 -0
  151. package/dist/src/nile-qr-code/nile-qr-code.css.d.ts +12 -0
  152. package/dist/src/nile-qr-code/nile-qr-code.css.js +24 -0
  153. package/dist/src/nile-qr-code/nile-qr-code.css.js.map +1 -0
  154. package/dist/src/nile-qr-code/nile-qr-code.d.ts +127 -0
  155. package/dist/src/nile-qr-code/nile-qr-code.js +381 -0
  156. package/dist/src/nile-qr-code/nile-qr-code.js.map +1 -0
  157. package/dist/src/nile-qr-code/nile-qr-code.test.d.ts +1 -0
  158. package/dist/src/nile-qr-code/nile-qr-code.test.js +719 -0
  159. package/dist/src/nile-qr-code/nile-qr-code.test.js.map +1 -0
  160. package/dist/src/nile-radio/nile-radio.css.js +1 -1
  161. package/dist/src/nile-radio/nile-radio.css.js.map +1 -1
  162. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js +25 -6
  163. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.css.js.map +1 -1
  164. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.d.ts +1 -0
  165. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js +17 -6
  166. package/dist/src/nile-rich-text-editor/nile-rich-text-editor.js.map +1 -1
  167. package/dist/src/nile-rich-text-editor/nile-rte-select.d.ts +1 -0
  168. package/dist/src/nile-rich-text-editor/nile-rte-select.js +7 -2
  169. package/dist/src/nile-rich-text-editor/nile-rte-select.js.map +1 -1
  170. package/dist/src/nile-select/nile-select.css.js +7 -4
  171. package/dist/src/nile-select/nile-select.css.js.map +1 -1
  172. package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js +5 -1
  173. package/dist/src/nile-slide-toggle/nile-slide-toggle.css.js.map +1 -1
  174. package/dist/src/nile-textarea/nile-textarea.css.js +10 -5
  175. package/dist/src/nile-textarea/nile-textarea.css.js.map +1 -1
  176. package/dist/src/nile-virtual-select/nile-virtual-select.css.js +5 -3
  177. package/dist/src/nile-virtual-select/nile-virtual-select.css.js.map +1 -1
  178. package/dist/src/version.js +1 -1
  179. package/dist/src/version.js.map +1 -1
  180. package/dist/tsconfig.tsbuildinfo +1 -1
  181. package/package.json +3 -2
  182. package/src/index.ts +2 -1
  183. package/src/nile-auto-complete/nile-auto-complete.css.ts +11 -0
  184. package/src/nile-button/nile-button.css.ts +89 -33
  185. package/src/nile-button/nile-button.ts +6 -5
  186. package/src/nile-calendar/nile-calendar.css.ts +57 -0
  187. package/src/nile-calendar/nile-calendar.ts +17 -6
  188. package/src/nile-checkbox/nile-checkbox.css.ts +4 -5
  189. package/src/nile-chip/nile-chip.css.ts +35 -21
  190. package/src/nile-code-editor/nile-code-editor.css.ts +7 -6
  191. package/src/nile-code-editor/nile-code-editor.ts +7 -1
  192. package/src/nile-date-picker/nile-date-picker.ts +22 -2
  193. package/src/nile-dropdown/nile-dropdown.ts +11 -0
  194. package/src/nile-file-upload/utils/file-validation.util.ts +10 -5
  195. package/src/nile-filter-chip/nile-filter-chip.css.ts +22 -0
  196. package/src/nile-filter-chip/nile-filter-chip.ts +2 -0
  197. package/src/nile-inline-edit/nile-inline-edit.css.ts +15 -6
  198. package/src/nile-inline-edit/nile-inline-edit.ts +4 -0
  199. package/src/nile-input/nile-input.css.ts +4 -4
  200. package/src/nile-link/nile-link.css.ts +1 -2
  201. package/src/nile-link/nile-link.ts +1 -0
  202. package/src/nile-qr-code/index.ts +1 -0
  203. package/src/nile-qr-code/nile-qr-code-utils.ts +733 -0
  204. package/src/nile-qr-code/nile-qr-code.css.ts +26 -0
  205. package/src/nile-qr-code/nile-qr-code.test.ts +879 -0
  206. package/src/nile-qr-code/nile-qr-code.ts +431 -0
  207. package/src/nile-radio/nile-radio.css.ts +1 -1
  208. package/src/nile-rich-text-editor/nile-rich-text-editor.css.ts +25 -6
  209. package/src/nile-rich-text-editor/nile-rich-text-editor.ts +14 -6
  210. package/src/nile-rich-text-editor/nile-rte-select.ts +5 -2
  211. package/src/nile-select/nile-select.css.ts +7 -4
  212. package/src/nile-slide-toggle/nile-slide-toggle.css.ts +5 -1
  213. package/src/nile-textarea/nile-textarea.css.ts +10 -5
  214. package/src/nile-virtual-select/nile-virtual-select.css.ts +5 -3
  215. package/vscode-html-custom-data.json +108 -6
  216. package/web-test-runner.config.mjs +1 -1
@@ -0,0 +1,719 @@
1
+ import { expect, fixture, html } from '@open-wc/testing';
2
+ import './nile-qr-code';
3
+ import NileQrCode from './nile-qr-code';
4
+ describe('NileQrCode', () => {
5
+ // === RENDERING ===
6
+ it('1. should render without errors', async () => {
7
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
8
+ expect(el).to.exist;
9
+ });
10
+ it('2. should have a shadow root', async () => {
11
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
12
+ expect(el.shadowRoot).to.not.be.null;
13
+ });
14
+ it('3. should render a canvas element', async () => {
15
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
16
+ const canvas = el.shadowRoot.querySelector('canvas');
17
+ expect(canvas).to.exist;
18
+ });
19
+ it('4. should have a canvas with correct default size', async () => {
20
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
21
+ const canvas = el.shadowRoot.querySelector('canvas');
22
+ expect(canvas.getAttribute('width')).to.equal('128');
23
+ expect(canvas.getAttribute('height')).to.equal('128');
24
+ });
25
+ it('5. shadow root should be open mode', async () => {
26
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
27
+ expect(el.shadowRoot.mode).to.equal('open');
28
+ });
29
+ // === DEFAULT PROPERTY VALUES ===
30
+ it('6. should have default value of empty string', async () => {
31
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
32
+ expect(el.value).to.equal('');
33
+ });
34
+ it('7. should have default size of 128', async () => {
35
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
36
+ expect(el.size).to.equal(128);
37
+ });
38
+ it('8. should have default fill of black', async () => {
39
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
40
+ expect(el.fill).to.equal('black');
41
+ });
42
+ it('9. should have default background of white', async () => {
43
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
44
+ expect(el.background).to.equal('white');
45
+ });
46
+ it('10. should have default radius of 0', async () => {
47
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
48
+ expect(el.radius).to.equal(0);
49
+ });
50
+ it('11. should have default errorCorrection of H', async () => {
51
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
52
+ expect(el.errorCorrection).to.equal('H');
53
+ });
54
+ it('12. should have default label of empty string', async () => {
55
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
56
+ expect(el.label).to.equal('');
57
+ });
58
+ // === PROPERTY SETTING ===
59
+ it('13. should accept value property', async () => {
60
+ const el = await fixture(html `<nile-qr-code value="https://example.com"></nile-qr-code>`);
61
+ expect(el.value).to.equal('https://example.com');
62
+ });
63
+ it('14. should accept size property', async () => {
64
+ const el = await fixture(html `<nile-qr-code size="256"></nile-qr-code>`);
65
+ expect(el.size).to.equal(256);
66
+ });
67
+ it('15. should accept fill property', async () => {
68
+ const el = await fixture(html `<nile-qr-code fill="red"></nile-qr-code>`);
69
+ expect(el.fill).to.equal('red');
70
+ });
71
+ it('16. should accept background property', async () => {
72
+ const el = await fixture(html `<nile-qr-code background="blue"></nile-qr-code>`);
73
+ expect(el.background).to.equal('blue');
74
+ });
75
+ it('17. should accept radius property', async () => {
76
+ const el = await fixture(html `<nile-qr-code radius="0.5"></nile-qr-code>`);
77
+ expect(el.radius).to.equal(0.5);
78
+ });
79
+ it('18. should accept error-correction property', async () => {
80
+ const el = await fixture(html `<nile-qr-code error-correction="L"></nile-qr-code>`);
81
+ expect(el.errorCorrection).to.equal('L');
82
+ });
83
+ it('19. should accept label property', async () => {
84
+ const el = await fixture(html `<nile-qr-code label="Scan me"></nile-qr-code>`);
85
+ expect(el.label).to.equal('Scan me');
86
+ });
87
+ // === ATTRIBUTE REFLECTION ===
88
+ it('20. should reflect value to attribute', async () => {
89
+ const el = await fixture(html `<nile-qr-code value="test"></nile-qr-code>`);
90
+ expect(el.getAttribute('value')).to.equal('test');
91
+ });
92
+ it('21. should reflect size to attribute', async () => {
93
+ const el = await fixture(html `<nile-qr-code size="64"></nile-qr-code>`);
94
+ expect(el.getAttribute('size')).to.equal('64');
95
+ });
96
+ it('22. should reflect fill to attribute', async () => {
97
+ const el = await fixture(html `<nile-qr-code fill="green"></nile-qr-code>`);
98
+ expect(el.getAttribute('fill')).to.equal('green');
99
+ });
100
+ it('23. should reflect background to attribute', async () => {
101
+ const el = await fixture(html `<nile-qr-code background="yellow"></nile-qr-code>`);
102
+ expect(el.getAttribute('background')).to.equal('yellow');
103
+ });
104
+ it('24. should reflect radius to attribute', async () => {
105
+ const el = await fixture(html `<nile-qr-code radius="0.3"></nile-qr-code>`);
106
+ expect(el.getAttribute('radius')).to.equal('0.3');
107
+ });
108
+ it('25. should reflect error-correction to attribute', async () => {
109
+ const el = await fixture(html `<nile-qr-code error-correction="M"></nile-qr-code>`);
110
+ expect(el.getAttribute('error-correction')).to.equal('M');
111
+ });
112
+ it('26. should reflect label to attribute', async () => {
113
+ const el = await fixture(html `<nile-qr-code label="My QR"></nile-qr-code>`);
114
+ expect(el.getAttribute('label')).to.equal('My QR');
115
+ });
116
+ // === ACCESSIBILITY ===
117
+ it('27. should have role=img on canvas', async () => {
118
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
119
+ const canvas = el.shadowRoot.querySelector('canvas');
120
+ expect(canvas.getAttribute('role')).to.equal('img');
121
+ });
122
+ it('28. should use label for aria-label when provided', async () => {
123
+ const el = await fixture(html `<nile-qr-code value="https://test.com" label="Scan this code"></nile-qr-code>`);
124
+ const canvas = el.shadowRoot.querySelector('canvas');
125
+ expect(canvas.getAttribute('aria-label')).to.equal('Scan this code');
126
+ });
127
+ it('29. should fallback to value for aria-label when no label', async () => {
128
+ const el = await fixture(html `<nile-qr-code value="https://test.com"></nile-qr-code>`);
129
+ const canvas = el.shadowRoot.querySelector('canvas');
130
+ expect(canvas.getAttribute('aria-label')).to.equal('https://test.com');
131
+ });
132
+ it('30. should fallback to "QR Code" for aria-label when no label and no value', async () => {
133
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
134
+ const canvas = el.shadowRoot.querySelector('canvas');
135
+ expect(canvas.getAttribute('aria-label')).to.equal('QR Code');
136
+ });
137
+ // === CSS PARTS ===
138
+ it('31. should have base part on canvas', async () => {
139
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
140
+ const canvas = el.shadowRoot.querySelector('[part="base"]');
141
+ expect(canvas).to.exist;
142
+ });
143
+ it('32. base part should be the canvas element', async () => {
144
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
145
+ const canvas = el.shadowRoot.querySelector('[part="base"]');
146
+ expect(canvas.tagName.toLowerCase()).to.equal('canvas');
147
+ });
148
+ // === SIZE CHANGES ===
149
+ it('33. should update canvas width when size changes', async () => {
150
+ const el = await fixture(html `<nile-qr-code size="64"></nile-qr-code>`);
151
+ const canvas = el.shadowRoot.querySelector('canvas');
152
+ expect(canvas.getAttribute('width')).to.equal('64');
153
+ });
154
+ it('34. should update canvas height when size changes', async () => {
155
+ const el = await fixture(html `<nile-qr-code size="256"></nile-qr-code>`);
156
+ const canvas = el.shadowRoot.querySelector('canvas');
157
+ expect(canvas.getAttribute('height')).to.equal('256');
158
+ });
159
+ it('35. should redraw when size property is changed programmatically', async () => {
160
+ const el = await fixture(html `<nile-qr-code value="test" size="128"></nile-qr-code>`);
161
+ el.size = 64;
162
+ await el.updateComplete;
163
+ const canvas = el.shadowRoot.querySelector('canvas');
164
+ expect(canvas.getAttribute('width')).to.equal('64');
165
+ });
166
+ // === VALUE CHANGES ===
167
+ it('36. should render QR code when value is set', async () => {
168
+ const el = await fixture(html `<nile-qr-code value="Hello"></nile-qr-code>`);
169
+ const canvas = el.shadowRoot.querySelector('canvas');
170
+ expect(canvas).to.exist;
171
+ // Canvas should have some drawn content
172
+ const ctx = canvas.getContext('2d');
173
+ expect(ctx).to.exist;
174
+ });
175
+ it('37. should redraw when value changes programmatically', async () => {
176
+ const el = await fixture(html `<nile-qr-code value="First"></nile-qr-code>`);
177
+ el.value = 'Second';
178
+ await el.updateComplete;
179
+ expect(el.value).to.equal('Second');
180
+ });
181
+ it('38. should handle empty value gracefully', async () => {
182
+ const el = await fixture(html `<nile-qr-code value=""></nile-qr-code>`);
183
+ expect(el).to.exist;
184
+ expect(el.shadowRoot.querySelector('canvas')).to.exist;
185
+ });
186
+ it('39. should handle long URLs', async () => {
187
+ const longUrl = 'https://example.com/' + 'a'.repeat(200);
188
+ const el = await fixture(html `<nile-qr-code value=${longUrl}></nile-qr-code>`);
189
+ expect(el).to.exist;
190
+ expect(el.value).to.equal(longUrl);
191
+ });
192
+ // === ERROR CORRECTION LEVELS ===
193
+ it('40. should accept error-correction L', async () => {
194
+ const el = await fixture(html `<nile-qr-code value="test" error-correction="L"></nile-qr-code>`);
195
+ expect(el.errorCorrection).to.equal('L');
196
+ });
197
+ it('41. should accept error-correction M', async () => {
198
+ const el = await fixture(html `<nile-qr-code value="test" error-correction="M"></nile-qr-code>`);
199
+ expect(el.errorCorrection).to.equal('M');
200
+ });
201
+ it('42. should accept error-correction Q', async () => {
202
+ const el = await fixture(html `<nile-qr-code value="test" error-correction="Q"></nile-qr-code>`);
203
+ expect(el.errorCorrection).to.equal('Q');
204
+ });
205
+ it('43. should accept error-correction H', async () => {
206
+ const el = await fixture(html `<nile-qr-code value="test" error-correction="H"></nile-qr-code>`);
207
+ expect(el.errorCorrection).to.equal('H');
208
+ });
209
+ // === RADIUS ===
210
+ it('44. should accept radius 0', async () => {
211
+ const el = await fixture(html `<nile-qr-code radius="0"></nile-qr-code>`);
212
+ expect(el.radius).to.equal(0);
213
+ });
214
+ it('45. should accept radius 0.5', async () => {
215
+ const el = await fixture(html `<nile-qr-code radius="0.5"></nile-qr-code>`);
216
+ expect(el.radius).to.equal(0.5);
217
+ });
218
+ it('46. should accept fractional radius values', async () => {
219
+ const el = await fixture(html `<nile-qr-code radius="0.25"></nile-qr-code>`);
220
+ expect(el.radius).to.equal(0.25);
221
+ });
222
+ // === COLOR PROPERTIES ===
223
+ it('47. should accept hex fill color', async () => {
224
+ const el = await fixture(html `<nile-qr-code fill="#FF0000"></nile-qr-code>`);
225
+ expect(el.fill).to.equal('#FF0000');
226
+ });
227
+ it('48. should accept rgb fill color', async () => {
228
+ const el = await fixture(html `<nile-qr-code fill="rgb(255,0,0)"></nile-qr-code>`);
229
+ expect(el.fill).to.equal('rgb(255,0,0)');
230
+ });
231
+ it('49. should accept transparent background', async () => {
232
+ const el = await fixture(html `<nile-qr-code background="transparent"></nile-qr-code>`);
233
+ expect(el.background).to.equal('transparent');
234
+ });
235
+ it('50. should accept hex background color', async () => {
236
+ const el = await fixture(html `<nile-qr-code background="#0000FF"></nile-qr-code>`);
237
+ expect(el.background).to.equal('#0000FF');
238
+ });
239
+ // === INSTANCE ===
240
+ it('51. should be instance of NileQrCode', async () => {
241
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
242
+ expect(el).to.be.instanceOf(NileQrCode);
243
+ });
244
+ it('52. should have correct tag name', async () => {
245
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
246
+ expect(el.tagName.toLowerCase()).to.equal('nile-qr-code');
247
+ });
248
+ it('53. should be a defined custom element', async () => {
249
+ expect(customElements.get('nile-qr-code')).to.exist;
250
+ });
251
+ it('54. should be registered as NileQrCode', async () => {
252
+ expect(customElements.get('nile-qr-code')).to.equal(NileQrCode);
253
+ });
254
+ // === STATIC STYLES ===
255
+ it('55. should have static styles', async () => {
256
+ const styles = NileQrCode.styles;
257
+ expect(styles).to.exist;
258
+ expect(Array.isArray(styles)).to.be.true;
259
+ });
260
+ it('56. styles array should have at least one entry', async () => {
261
+ const styles = NileQrCode.styles;
262
+ expect(styles.length).to.be.greaterThan(0);
263
+ });
264
+ // === RENDER METHOD ===
265
+ it('57. should have render method', async () => {
266
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
267
+ expect(el.render).to.be.a('function');
268
+ });
269
+ it('58. render should return a TemplateResult', async () => {
270
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
271
+ const result = el.render();
272
+ expect(result).to.exist;
273
+ });
274
+ it('59. should not throw when render is called', async () => {
275
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
276
+ expect(() => el.render()).to.not.throw();
277
+ });
278
+ // === UPDATE LIFECYCLE ===
279
+ it('60. should have updateComplete promise', async () => {
280
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
281
+ expect(el.updateComplete).to.be.a('promise');
282
+ });
283
+ it('61. updateComplete should resolve', async () => {
284
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
285
+ const result = await el.updateComplete;
286
+ expect(result).to.not.be.undefined;
287
+ });
288
+ it('62. should render consistently after re-render', async () => {
289
+ const el = await fixture(html `<nile-qr-code value="test"></nile-qr-code>`);
290
+ await el.requestUpdate();
291
+ await el.updateComplete;
292
+ const canvas = el.shadowRoot.querySelector('canvas');
293
+ expect(canvas).to.exist;
294
+ });
295
+ it('63. should maintain canvas after multiple updates', async () => {
296
+ const el = await fixture(html `<nile-qr-code value="test"></nile-qr-code>`);
297
+ for (let i = 0; i < 5; i++) {
298
+ await el.requestUpdate();
299
+ await el.updateComplete;
300
+ }
301
+ const canvas = el.shadowRoot.querySelector('canvas');
302
+ expect(canvas).to.exist;
303
+ });
304
+ // === DOM STRUCTURE ===
305
+ it('64. canvas should be the only child in shadow root template', async () => {
306
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
307
+ const canvases = el.shadowRoot.querySelectorAll('canvas');
308
+ expect(canvases.length).to.equal(1);
309
+ });
310
+ it('65. should not have any slot elements', async () => {
311
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
312
+ const slots = el.shadowRoot.querySelectorAll('slot');
313
+ expect(slots.length).to.equal(0);
314
+ });
315
+ it('66. should not have any input elements', async () => {
316
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
317
+ const inputs = el.shadowRoot.querySelectorAll('input');
318
+ expect(inputs.length).to.equal(0);
319
+ });
320
+ it('67. should not have any button elements', async () => {
321
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
322
+ const buttons = el.shadowRoot.querySelectorAll('button');
323
+ expect(buttons.length).to.equal(0);
324
+ });
325
+ it('68. should not have any SVG elements', async () => {
326
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
327
+ const svgs = el.shadowRoot.querySelectorAll('svg');
328
+ expect(svgs.length).to.equal(0);
329
+ });
330
+ it('69. should not have light DOM content', async () => {
331
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
332
+ expect(el.childNodes.length).to.equal(0);
333
+ });
334
+ // === DOM MANIPULATION ===
335
+ it('70. should render after being added to DOM programmatically', async () => {
336
+ const container = await fixture(html `<div></div>`);
337
+ const el = document.createElement('nile-qr-code');
338
+ container.appendChild(el);
339
+ await el.updateComplete;
340
+ expect(el.shadowRoot.querySelector('canvas')).to.exist;
341
+ });
342
+ it('71. should handle removal and re-addition', async () => {
343
+ const container = await fixture(html `<div></div>`);
344
+ const el = document.createElement('nile-qr-code');
345
+ container.appendChild(el);
346
+ await el.updateComplete;
347
+ container.removeChild(el);
348
+ container.appendChild(el);
349
+ await el.updateComplete;
350
+ expect(el.shadowRoot.querySelector('canvas')).to.exist;
351
+ });
352
+ it('72. should work when created via new', async () => {
353
+ const el = new NileQrCode();
354
+ document.body.appendChild(el);
355
+ await el.updateComplete;
356
+ expect(el.shadowRoot.querySelector('canvas')).to.exist;
357
+ document.body.removeChild(el);
358
+ });
359
+ it('73. should be connectedCallback-compatible', async () => {
360
+ const el = document.createElement('nile-qr-code');
361
+ document.body.appendChild(el);
362
+ await el.updateComplete;
363
+ expect(el.isConnected).to.be.true;
364
+ document.body.removeChild(el);
365
+ });
366
+ it('74. should handle disconnectedCallback', async () => {
367
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
368
+ el.remove();
369
+ expect(el.isConnected).to.be.false;
370
+ });
371
+ // === RENDERING CONTEXTS ===
372
+ it('75. should render correctly inside a flex container', async () => {
373
+ const container = await fixture(html `<div style="display:flex"><nile-qr-code value="test"></nile-qr-code></div>`);
374
+ const qr = container.querySelector('nile-qr-code');
375
+ expect(qr.shadowRoot.querySelector('canvas')).to.exist;
376
+ });
377
+ it('76. should render correctly inside a grid container', async () => {
378
+ const container = await fixture(html `<div style="display:grid"><nile-qr-code value="test"></nile-qr-code></div>`);
379
+ const qr = container.querySelector('nile-qr-code');
380
+ expect(qr.shadowRoot.querySelector('canvas')).to.exist;
381
+ });
382
+ it('77. should render correctly with class attribute', async () => {
383
+ const el = await fixture(html `<nile-qr-code class="custom-class"></nile-qr-code>`);
384
+ expect(el.classList.contains('custom-class')).to.be.true;
385
+ });
386
+ it('78. should render correctly with id attribute', async () => {
387
+ const el = await fixture(html `<nile-qr-code id="my-qr"></nile-qr-code>`);
388
+ expect(el.id).to.equal('my-qr');
389
+ });
390
+ it('79. should render correctly with style attribute', async () => {
391
+ const el = await fixture(html `<nile-qr-code style="margin:10px"></nile-qr-code>`);
392
+ expect(el.style.margin).to.equal('10px');
393
+ });
394
+ it('80. should render correctly with hidden attribute', async () => {
395
+ const el = await fixture(html `<nile-qr-code hidden></nile-qr-code>`);
396
+ expect(el.hidden).to.be.true;
397
+ });
398
+ // === MULTIPLE INSTANCES ===
399
+ it('81. should render multiple QR codes independently', async () => {
400
+ const container = await fixture(html `
401
+ <div>
402
+ <nile-qr-code value="One"></nile-qr-code>
403
+ <nile-qr-code value="Two"></nile-qr-code>
404
+ <nile-qr-code value="Three"></nile-qr-code>
405
+ </div>
406
+ `);
407
+ const qrCodes = container.querySelectorAll('nile-qr-code');
408
+ expect(qrCodes.length).to.equal(3);
409
+ });
410
+ it('82. each QR code should have its own shadow root', async () => {
411
+ const container = await fixture(html `
412
+ <div>
413
+ <nile-qr-code value="A"></nile-qr-code>
414
+ <nile-qr-code value="B"></nile-qr-code>
415
+ </div>
416
+ `);
417
+ const qrCodes = container.querySelectorAll('nile-qr-code');
418
+ expect(qrCodes[0].shadowRoot).to.not.equal(qrCodes[1].shadowRoot);
419
+ });
420
+ it('83. multiple instances should each have a canvas', async () => {
421
+ const container = await fixture(html `
422
+ <div>
423
+ <nile-qr-code value="X"></nile-qr-code>
424
+ <nile-qr-code value="Y"></nile-qr-code>
425
+ </div>
426
+ `);
427
+ const qrCodes = container.querySelectorAll('nile-qr-code');
428
+ qrCodes.forEach(qr => {
429
+ expect(qr.shadowRoot.querySelector('canvas')).to.exist;
430
+ });
431
+ });
432
+ // === PROGRAMMATIC PROPERTY CHANGES ===
433
+ it('84. should redraw when fill changes programmatically', async () => {
434
+ const el = await fixture(html `<nile-qr-code value="test" fill="black"></nile-qr-code>`);
435
+ el.fill = 'red';
436
+ await el.updateComplete;
437
+ expect(el.fill).to.equal('red');
438
+ });
439
+ it('85. should redraw when background changes programmatically', async () => {
440
+ const el = await fixture(html `<nile-qr-code value="test" background="white"></nile-qr-code>`);
441
+ el.background = 'transparent';
442
+ await el.updateComplete;
443
+ expect(el.background).to.equal('transparent');
444
+ });
445
+ it('86. should redraw when radius changes programmatically', async () => {
446
+ const el = await fixture(html `<nile-qr-code value="test" radius="0"></nile-qr-code>`);
447
+ el.radius = 0.3;
448
+ await el.updateComplete;
449
+ expect(el.radius).to.equal(0.3);
450
+ });
451
+ it('87. should redraw when errorCorrection changes programmatically', async () => {
452
+ const el = await fixture(html `<nile-qr-code value="test" error-correction="H"></nile-qr-code>`);
453
+ el.errorCorrection = 'L';
454
+ await el.updateComplete;
455
+ expect(el.errorCorrection).to.equal('L');
456
+ });
457
+ // === EDGE CASES ===
458
+ it('88. should handle being moved between containers', async () => {
459
+ const container1 = await fixture(html `<div></div>`);
460
+ const container2 = await fixture(html `<div></div>`);
461
+ const el = document.createElement('nile-qr-code');
462
+ container1.appendChild(el);
463
+ await el.updateComplete;
464
+ container2.appendChild(el);
465
+ await el.updateComplete;
466
+ expect(el.shadowRoot.querySelector('canvas')).to.exist;
467
+ });
468
+ it('89. should handle rapid add/remove', async () => {
469
+ const container = await fixture(html `<div></div>`);
470
+ const el = document.createElement('nile-qr-code');
471
+ container.appendChild(el);
472
+ container.removeChild(el);
473
+ container.appendChild(el);
474
+ await el.updateComplete;
475
+ expect(el.shadowRoot.querySelector('canvas')).to.exist;
476
+ });
477
+ it('90. shadowRoot host should reference the element', async () => {
478
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
479
+ expect(el.shadowRoot.host).to.equal(el);
480
+ });
481
+ it('91. should handle data-* attributes gracefully', async () => {
482
+ const el = await fixture(html `<nile-qr-code data-testid="qr1"></nile-qr-code>`);
483
+ expect(el.getAttribute('data-testid')).to.equal('qr1');
484
+ });
485
+ it('92. should handle setting custom aria attributes', async () => {
486
+ const el = await fixture(html `<nile-qr-code aria-hidden="true"></nile-qr-code>`);
487
+ expect(el.getAttribute('aria-hidden')).to.equal('true');
488
+ });
489
+ // === CANVAS ATTRIBUTES ===
490
+ it('93. canvas should have width attribute matching size', async () => {
491
+ const el = await fixture(html `<nile-qr-code size="200"></nile-qr-code>`);
492
+ const canvas = el.shadowRoot.querySelector('canvas');
493
+ expect(canvas.getAttribute('width')).to.equal('200');
494
+ });
495
+ it('94. canvas should have height attribute matching size', async () => {
496
+ const el = await fixture(html `<nile-qr-code size="200"></nile-qr-code>`);
497
+ const canvas = el.shadowRoot.querySelector('canvas');
498
+ expect(canvas.getAttribute('height')).to.equal('200');
499
+ });
500
+ it('95. canvas should have part attribute', async () => {
501
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
502
+ const canvas = el.shadowRoot.querySelector('canvas');
503
+ expect(canvas.getAttribute('part')).to.equal('base');
504
+ });
505
+ it('96. canvas should have role attribute', async () => {
506
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
507
+ const canvas = el.shadowRoot.querySelector('canvas');
508
+ expect(canvas.hasAttribute('role')).to.be.true;
509
+ });
510
+ it('97. canvas should have aria-label attribute', async () => {
511
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
512
+ const canvas = el.shadowRoot.querySelector('canvas');
513
+ expect(canvas.hasAttribute('aria-label')).to.be.true;
514
+ });
515
+ // === CONNECTED STATE ===
516
+ it('98. should be in connected state after fixture', async () => {
517
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
518
+ expect(el.isConnected).to.be.true;
519
+ });
520
+ it('99. should not affect parent container', async () => {
521
+ const container = await fixture(html `<div class="parent"><nile-qr-code></nile-qr-code></div>`);
522
+ expect(container.classList.contains('parent')).to.be.true;
523
+ expect(container.children.length).to.equal(1);
524
+ });
525
+ it('100. should handle all properties at once', async () => {
526
+ const el = await fixture(html `
527
+ <nile-qr-code
528
+ value="https://example.com"
529
+ size="256"
530
+ fill="#333"
531
+ background="#FFF"
532
+ radius="0.4"
533
+ error-correction="Q"
534
+ label="Scan to visit"
535
+ ></nile-qr-code>
536
+ `);
537
+ expect(el.value).to.equal('https://example.com');
538
+ expect(el.size).to.equal(256);
539
+ expect(el.fill).to.equal('#333');
540
+ expect(el.background).to.equal('#FFF');
541
+ expect(el.radius).to.equal(0.4);
542
+ expect(el.errorCorrection).to.equal('Q');
543
+ expect(el.label).to.equal('Scan to visit');
544
+ const canvas = el.shadowRoot.querySelector('canvas');
545
+ expect(canvas).to.exist;
546
+ expect(canvas.getAttribute('aria-label')).to.equal('Scan to visit');
547
+ });
548
+ // === IMAGE OVERLAY DEFAULTS ===
549
+ it('101. should have default image of empty string', async () => {
550
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
551
+ expect(el.image).to.equal('');
552
+ });
553
+ it('102. should have default imageSize of 0.25', async () => {
554
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
555
+ expect(el.imageSize).to.equal(0.25);
556
+ });
557
+ it('103. should have default imagePadding of 4', async () => {
558
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
559
+ expect(el.imagePadding).to.equal(4);
560
+ });
561
+ it('104. should have default imageRadius of 4', async () => {
562
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
563
+ expect(el.imageRadius).to.equal(4);
564
+ });
565
+ // === IMAGE OVERLAY PROPERTY SETTING ===
566
+ it('105. should accept image property', async () => {
567
+ const el = await fixture(html `<nile-qr-code image="https://example.com/logo.png"></nile-qr-code>`);
568
+ expect(el.image).to.equal('https://example.com/logo.png');
569
+ });
570
+ it('106. should accept image-size property', async () => {
571
+ const el = await fixture(html `<nile-qr-code image-size="0.3"></nile-qr-code>`);
572
+ expect(el.imageSize).to.equal(0.3);
573
+ });
574
+ it('107. should accept image-padding property', async () => {
575
+ const el = await fixture(html `<nile-qr-code image-padding="8"></nile-qr-code>`);
576
+ expect(el.imagePadding).to.equal(8);
577
+ });
578
+ it('108. should accept image-radius property', async () => {
579
+ const el = await fixture(html `<nile-qr-code image-radius="12"></nile-qr-code>`);
580
+ expect(el.imageRadius).to.equal(12);
581
+ });
582
+ // === IMAGE OVERLAY ATTRIBUTE REFLECTION ===
583
+ it('109. should reflect image to attribute', async () => {
584
+ const el = await fixture(html `<nile-qr-code image="logo.png"></nile-qr-code>`);
585
+ expect(el.getAttribute('image')).to.equal('logo.png');
586
+ });
587
+ it('110. should reflect image-size to attribute', async () => {
588
+ const el = await fixture(html `<nile-qr-code image-size="0.35"></nile-qr-code>`);
589
+ expect(el.getAttribute('image-size')).to.equal('0.35');
590
+ });
591
+ it('111. should reflect image-padding to attribute', async () => {
592
+ const el = await fixture(html `<nile-qr-code image-padding="6"></nile-qr-code>`);
593
+ expect(el.getAttribute('image-padding')).to.equal('6');
594
+ });
595
+ it('112. should reflect image-radius to attribute', async () => {
596
+ const el = await fixture(html `<nile-qr-code image-radius="10"></nile-qr-code>`);
597
+ expect(el.getAttribute('image-radius')).to.equal('10');
598
+ });
599
+ // === IMAGE OVERLAY RENDERING ===
600
+ it('113. should still render canvas when image is set', async () => {
601
+ const el = await fixture(html `<nile-qr-code value="test" image="https://example.com/logo.png"></nile-qr-code>`);
602
+ expect(el.shadowRoot.querySelector('canvas')).to.exist;
603
+ });
604
+ it('114. should handle invalid image URL gracefully', async () => {
605
+ const el = await fixture(html `<nile-qr-code value="test" image="not-a-valid-url"></nile-qr-code>`);
606
+ await el.updateComplete;
607
+ expect(el).to.exist;
608
+ expect(el.shadowRoot.querySelector('canvas')).to.exist;
609
+ });
610
+ it('115. should handle image property change programmatically', async () => {
611
+ const el = await fixture(html `<nile-qr-code value="test"></nile-qr-code>`);
612
+ el.image = 'https://example.com/logo.png';
613
+ await el.updateComplete;
614
+ expect(el.image).to.equal('https://example.com/logo.png');
615
+ });
616
+ it('116. should clear image when set to empty string', async () => {
617
+ const el = await fixture(html `<nile-qr-code value="test" image="https://example.com/logo.png"></nile-qr-code>`);
618
+ el.image = '';
619
+ await el.updateComplete;
620
+ expect(el.image).to.equal('');
621
+ });
622
+ // === GRADIENT FILL DEFAULTS ===
623
+ it('117. should have default fillGradient of empty string', async () => {
624
+ const el = await fixture(html `<nile-qr-code></nile-qr-code>`);
625
+ expect(el.fillGradient).to.equal('');
626
+ });
627
+ // === GRADIENT FILL PROPERTY SETTING ===
628
+ it('118. should accept fill-gradient property', async () => {
629
+ const el = await fixture(html `<nile-qr-code fill-gradient="135, #6366f1, #ec4899"></nile-qr-code>`);
630
+ expect(el.fillGradient).to.equal('135, #6366f1, #ec4899');
631
+ });
632
+ it('119. should reflect fill-gradient to attribute', async () => {
633
+ const el = await fixture(html `<nile-qr-code fill-gradient="90, red, blue"></nile-qr-code>`);
634
+ expect(el.getAttribute('fill-gradient')).to.equal('90, red, blue');
635
+ });
636
+ it('120. should render with gradient fill', async () => {
637
+ const el = await fixture(html `<nile-qr-code value="test" fill-gradient="45, #000, #fff"></nile-qr-code>`);
638
+ expect(el.shadowRoot.querySelector('canvas')).to.exist;
639
+ });
640
+ it('121. should fallback to fill when gradient is malformed', async () => {
641
+ const el = await fixture(html `<nile-qr-code value="test" fill-gradient="invalid"></nile-qr-code>`);
642
+ await el.updateComplete;
643
+ expect(el).to.exist;
644
+ expect(el.shadowRoot.querySelector('canvas')).to.exist;
645
+ });
646
+ it('122. should handle gradient with multiple color stops', async () => {
647
+ const el = await fixture(html `<nile-qr-code value="test" fill-gradient="180, red, orange, yellow, green"></nile-qr-code>`);
648
+ await el.updateComplete;
649
+ expect(el).to.exist;
650
+ });
651
+ it('123. should handle gradient change programmatically', async () => {
652
+ const el = await fixture(html `<nile-qr-code value="test"></nile-qr-code>`);
653
+ el.fillGradient = '90, #333, #999';
654
+ await el.updateComplete;
655
+ expect(el.fillGradient).to.equal('90, #333, #999');
656
+ });
657
+ // === DOWNLOAD METHOD ===
658
+ it('124. should have a download method', async () => {
659
+ const el = await fixture(html `<nile-qr-code value="test"></nile-qr-code>`);
660
+ expect(el.download).to.be.a('function');
661
+ });
662
+ it('125. should have a toDataURL method', async () => {
663
+ const el = await fixture(html `<nile-qr-code value="test"></nile-qr-code>`);
664
+ expect(el.toDataURL).to.be.a('function');
665
+ });
666
+ it('126. toDataURL should return a data URL string', async () => {
667
+ const el = await fixture(html `<nile-qr-code value="test"></nile-qr-code>`);
668
+ const dataUrl = el.toDataURL();
669
+ expect(dataUrl).to.be.a('string');
670
+ expect(dataUrl).to.include('data:image/png');
671
+ });
672
+ it('127. toDataURL should accept a custom MIME type', async () => {
673
+ const el = await fixture(html `<nile-qr-code value="test"></nile-qr-code>`);
674
+ const dataUrl = el.toDataURL('image/jpeg');
675
+ expect(dataUrl).to.be.a('string');
676
+ });
677
+ it('128. download should not throw', async () => {
678
+ const el = await fixture(html `<nile-qr-code value="test"></nile-qr-code>`);
679
+ expect(() => el.download('test.png')).to.not.throw();
680
+ });
681
+ // === COMBINED FEATURES ===
682
+ it('129. should handle gradient + rounded modules together', async () => {
683
+ const el = await fixture(html `
684
+ <nile-qr-code
685
+ value="test"
686
+ radius="0.5"
687
+ fill-gradient="45, #6366f1, #ec4899">
688
+ </nile-qr-code>
689
+ `);
690
+ await el.updateComplete;
691
+ expect(el.shadowRoot.querySelector('canvas')).to.exist;
692
+ });
693
+ it('130. should handle all new properties at once', async () => {
694
+ const el = await fixture(html `
695
+ <nile-qr-code
696
+ value="https://example.com"
697
+ size="256"
698
+ fill="#333"
699
+ background="#FFF"
700
+ radius="0.3"
701
+ error-correction="H"
702
+ label="Full featured"
703
+ image="https://example.com/logo.png"
704
+ image-size="0.25"
705
+ image-padding="6"
706
+ image-radius="8"
707
+ fill-gradient="135, #6366f1, #ec4899">
708
+ </nile-qr-code>
709
+ `);
710
+ expect(el.value).to.equal('https://example.com');
711
+ expect(el.size).to.equal(256);
712
+ expect(el.imageSize).to.equal(0.25);
713
+ expect(el.imagePadding).to.equal(6);
714
+ expect(el.imageRadius).to.equal(8);
715
+ expect(el.fillGradient).to.equal('135, #6366f1, #ec4899');
716
+ expect(el.shadowRoot.querySelector('canvas')).to.exist;
717
+ });
718
+ });
719
+ //# sourceMappingURL=nile-qr-code.test.js.map