@malloydata/malloy-tests 0.0.156 → 0.0.157-dev240805135237

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/package.json CHANGED
@@ -21,13 +21,13 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@jest/globals": "^29.4.3",
24
- "@malloydata/db-bigquery": "^0.0.156",
25
- "@malloydata/db-duckdb": "^0.0.156",
26
- "@malloydata/db-postgres": "^0.0.156",
27
- "@malloydata/db-snowflake": "^0.0.156",
28
- "@malloydata/db-trino": "^0.0.156",
29
- "@malloydata/malloy": "^0.0.156",
30
- "@malloydata/render": "^0.0.156",
24
+ "@malloydata/db-bigquery": "^0.0.157-dev240805135237",
25
+ "@malloydata/db-duckdb": "^0.0.157-dev240805135237",
26
+ "@malloydata/db-postgres": "^0.0.157-dev240805135237",
27
+ "@malloydata/db-snowflake": "^0.0.157-dev240805135237",
28
+ "@malloydata/db-trino": "^0.0.157-dev240805135237",
29
+ "@malloydata/malloy": "^0.0.157-dev240805135237",
30
+ "@malloydata/render": "^0.0.157-dev240805135237",
31
31
  "jsdom": "^22.1.0",
32
32
  "luxon": "^2.4.0",
33
33
  "madge": "^6.0.0"
@@ -36,5 +36,5 @@
36
36
  "@types/jsdom": "^21.1.1",
37
37
  "@types/luxon": "^2.4.0"
38
38
  },
39
- "version": "0.0.156"
39
+ "version": "0.0.157-dev240805135237"
40
40
  }
@@ -11848,6 +11848,93 @@ exports[`rendering results html renderer pivot table renders correctly 1`] = `
11848
11848
  </table>
11849
11849
  `;
11850
11850
 
11851
+ exports[`rendering results link renderer data volume tags works correctly 1`] = `
11852
+ <table
11853
+ style="vertical-align: top; border-collapse: collapse; width: 100%;"
11854
+ >
11855
+ <thead>
11856
+ <tr>
11857
+ <th
11858
+ style="padding: 8px; text-align: left;"
11859
+ >
11860
+ just_​link
11861
+ </th>
11862
+ <th
11863
+ style="padding: 8px; text-align: left;"
11864
+ >
11865
+ link_​append
11866
+ </th>
11867
+ <th
11868
+ style="padding: 8px; text-align: left;"
11869
+ >
11870
+ link_​substitue
11871
+ </th>
11872
+ <th
11873
+ style="padding: 8px; text-align: left;"
11874
+ >
11875
+ link_​with_​key
11876
+ </th>
11877
+ <th
11878
+ style="padding: 8px; text-align: left;"
11879
+ >
11880
+ key
11881
+ </th>
11882
+ </tr>
11883
+ </thead>
11884
+ <tbody>
11885
+ <tr>
11886
+ <td
11887
+ style="padding: 8px; vertical-align: top;"
11888
+ >
11889
+ <a
11890
+ href="http://123.com"
11891
+ target="_blank"
11892
+ >
11893
+ http:/‌/‌123.com
11894
+ </a>
11895
+ </td>
11896
+ <td
11897
+ style="padding: 8px; vertical-align: top;"
11898
+ >
11899
+ <a
11900
+ href="http://123.com/4"
11901
+ target="_blank"
11902
+ >
11903
+ 4
11904
+ </a>
11905
+ </td>
11906
+ <td
11907
+ style="padding: 8px; vertical-align: top;"
11908
+ >
11909
+ <a
11910
+ href="http://123.com/4/5"
11911
+ target="_blank"
11912
+ >
11913
+ 4
11914
+ </a>
11915
+ </td>
11916
+ <td
11917
+ style="padding: 8px; vertical-align: top;"
11918
+ >
11919
+ <a
11920
+ href="http://123.com/4/5"
11921
+ target="_blank"
11922
+ >
11923
+ HTML Text
11924
+ </a>
11925
+ </td>
11926
+ <td
11927
+ style="padding: 8px; vertical-align: top;"
11928
+ >
11929
+ <span>
11930
+ 4
11931
+ </span>
11932
+ </td>
11933
+ </tr>
11934
+ </tbody>
11935
+ </table>
11936
+ `;
11937
+
11851
11938
  exports[`rendering results number renderer value format tags works correctly 1`] = `
11852
11939
  <table
11853
11940
  style="vertical-align: top; border-collapse: collapse; width: 100%;"
@@ -645,6 +645,35 @@ describe('rendering results', () => {
645
645
  });
646
646
  });
647
647
 
648
+ describe('link renderer', () => {
649
+ test('data volume tags works correctly', async () => {
650
+ const src = `
651
+ query: bytes_query is duckdb.sql('SELECT 1 as one') -> {
652
+ select:
653
+ # link
654
+ just_link is "http://123.com"
655
+ # link.url_template="http://123.com/"
656
+ link_append is "4"
657
+ # link.url_template="http://123.com/$$/5"
658
+ link_substitue is "4"
659
+ # link{url_template="http://123.com/$$/5", key_column=key}
660
+ link_with_key is 'HTML Text'
661
+ key is "4"
662
+ }
663
+ `;
664
+ const result = await (
665
+ await duckdb.loadModel(src).loadQueryByName('bytes_query')
666
+ ).run();
667
+ const document = new JSDOM().window.document;
668
+ const html = await new HTMLView(document).render(result, {
669
+ dataStyles: {},
670
+ });
671
+ // console.log(html.outerHTML);
672
+
673
+ expect(html).toMatchSnapshot();
674
+ });
675
+ });
676
+
648
677
  describe('duration renderer', () => {
649
678
  test('duration tags works correctly', async () => {
650
679
  const src = `