@civicactions/cmsds-open-data-components 1.13.0-alpha.2 → 1.13.0-beta.1

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.
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ require("./templates/footer");
4
+
5
+ require("./templates/header");
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ Cypress.Commands.add('testFooterGetUpdates', function (title, description, link) {
4
+ cy.findByRole('heading', {
5
+ name: title,
6
+ level: 2
7
+ }).should('exist');
8
+ cy.findByText(description).should('exist');
9
+ cy.findByRole('link', {
10
+ name: link.label
11
+ }).should('have.attr', 'href', link.url);
12
+ });
13
+ Cypress.Commands.add('testFooterCMSInfo', function () {
14
+ cy.findByRole('link', {
15
+ name: 'U.S. Department of Health & Human Services'
16
+ }).should('have.attr', 'href', 'http://www.hhs.gov/'); //change to https when moving upstream
17
+
18
+ cy.findByAltText('HHS Logo').should('exist');
19
+ cy.findByRole('link', {
20
+ name: 'CMS.gov Centers for Medicare & Medicaid Services'
21
+ }).should('have.attr', 'href', 'http://www.cms.gov/'); //change to https when moving upstream
22
+
23
+ cy.findByAltText('CMS Logo').should('exist');
24
+ cy.findByText('A federal government website managed and paid for by the U.S. Centers for Medicare & Medicaid Services.').should('exist');
25
+ cy.findByText('7500 Security Boulevard, Baltimore, MD 21244').should('exist');
26
+ });
27
+ Cypress.Commands.add('testFooterGlobalLinks', function (links) {
28
+ cy.get('.dc-c-footer__utility').findAllByRole('listitem').should('have.length', links.length);
29
+ links.forEach(function (link) {
30
+ cy.findByRole('link', {
31
+ name: link.label
32
+ }).should('have.attr', 'href', link.url);
33
+ });
34
+ });
35
+ Cypress.Commands.add('testFooterSocialLinks', function (links) {
36
+ cy.get('.dc-c-footer__cms-information').findAllByRole('listitem').should('have.length', links.length);
37
+ links.forEach(function (link) {
38
+ var currentLink = cy.findByRole('link', {
39
+ name: link.label
40
+ });
41
+ currentLink.should('have.attr', 'href', link.url);
42
+ currentLink.within(function () {
43
+ // The background circle SVG doesn't have a role of img.
44
+ cy.findAllByRole('img').should('have.length', 1);
45
+ });
46
+ });
47
+ });
48
+ Cypress.Commands.add('testFooterResource', function (links, title) {
49
+ var heading = cy.findByRole('heading', {
50
+ name: title,
51
+ level: 2
52
+ });
53
+ heading.should('exist');
54
+ heading.parent().findAllByRole('listitem').should('have.length', links.length);
55
+ links.forEach(function (link) {
56
+ var currentLink = cy.findByRole('link', {
57
+ name: link.label
58
+ });
59
+ currentLink.should('have.attr', 'href', link.url);
60
+ });
61
+ });
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ Cypress.Commands.add('testUSABanner', function () {
4
+ var buttonText = 'Here’s how you know';
5
+ cy.findByRole('img', {
6
+ name: 'U.S. Flag'
7
+ }).should('exist');
8
+ cy.findByText('An official website of the United States government').should('exist');
9
+ cy.findByRole('button', {
10
+ name: buttonText
11
+ }).should('exist');
12
+ cy.findByText(/Official websites use .gov/i).should('not.be.visible');
13
+ cy.findByText(/Secure .gov websites use HTTPS/i).should('not.be.visible');
14
+ cy.get('.ds-c-usa-banner__button .ds-c-icon--arrow-down').should('exist');
15
+ cy.get('.ds-c-usa-banner__button .ds-c-icon--arrow-up').should('not.exist');
16
+ cy.findByRole('button', {
17
+ name: buttonText
18
+ }).click();
19
+ cy.findByText(/Official websites use .gov/i).should('be.visible');
20
+ cy.findByText(/Secure .gov websites use HTTPS/i).should('be.visible');
21
+ cy.get('.ds-c-usa-banner__button .ds-c-icon--arrow-down').should('not.exist');
22
+ cy.get('.ds-c-usa-banner__button .ds-c-icon--arrow-up').should('exist');
23
+ cy.findByRole('button', {
24
+ name: buttonText
25
+ }).click();
26
+ cy.findByText(/Official websites use .gov/i).should('not.be.visible');
27
+ cy.findByText(/Secure .gov websites use HTTPS/i).should('not.be.visible');
28
+ cy.get('.ds-c-usa-banner__button .ds-c-icon--arrow-down').should('exist');
29
+ cy.get('.ds-c-usa-banner__button .ds-c-icon--arrow-up').should('not.exist');
30
+ });
31
+ Cypress.Commands.add('desktopCMSHeader', function (mainLink, tagline, cmsLinks) {
32
+ cy.viewport(1150, 720);
33
+ cy.get('.dc-c-cmsheader').within(function (div) {
34
+ cy.findByRole('link', {
35
+ name: mainLink.title
36
+ }).should('have.attr', 'href', mainLink.url);
37
+ cy.findByAltText(mainLink.altText).should('exist');
38
+ });
39
+ cy.findByText(tagline).should('exist');
40
+ cmsLinks.forEach(function (link) {
41
+ cy.findByRole('link', {
42
+ name: link.label
43
+ }).should('have.attr', 'href', link.url);
44
+ });
45
+ });
46
+ Cypress.Commands.add('tabletCMSHeader', function (mainLink, tagline, cmsLinks) {
47
+ cy.viewport(720, 720);
48
+ cy.get('.dc-c-cmsheader').within(function (div) {
49
+ cy.findByRole('link', {
50
+ name: mainLink.title
51
+ }).should('have.attr', 'href', mainLink.url);
52
+ cy.findByAltText(mainLink.altText).should('exist');
53
+ });
54
+ cy.findByText(tagline).should('not.exist');
55
+ cmsLinks.forEach(function (link) {
56
+ cy.findByRole('link', {
57
+ name: link.label
58
+ }).should('have.attr', 'href', link.url);
59
+ });
60
+ });
61
+ Cypress.Commands.add('mobileCMSHeader', function (mainLink, tagline, cmsLinks) {
62
+ cy.viewport(300, 720);
63
+ cy.get('.dc-c-cmsheader').within(function (div) {
64
+ cy.findByRole('link', {
65
+ name: mainLink.title
66
+ }).should('have.attr', 'href', mainLink.url);
67
+ cy.findByAltText(mainLink.altText).should('exist');
68
+ });
69
+ cy.findByText(tagline).should('not.exist');
70
+ cy.get('.dc-c-cmsheader-menu').should('not.exist');
71
+ cmsLinks.forEach(function (link) {
72
+ cy.findByRole('link', {
73
+ name: link.label
74
+ }).should('not.be.visible');
75
+ });
76
+ });
77
+ Cypress.Commands.add('testNoCMSHeader', function () {
78
+ cy.get('.dc-c-cmsheader').should('not.exist');
79
+ });
80
+ Cypress.Commands.add('testCMSHeader', function (mainLink, tagline, cmsLinks) {
81
+ cy.desktopCMSHeader(mainLink, tagline, cmsLinks);
82
+ cy.tabletCMSHeader(mainLink, tagline, cmsLinks);
83
+ cy.mobileCMSHeader(mainLink, tagline, cmsLinks);
84
+ });
@@ -102,9 +102,9 @@ var ResourceHeader = function ResourceHeader(_ref) {
102
102
  }, /*#__PURE__*/_react["default"].createElement("div", {
103
103
  className: "ds-u-font-weight--bold"
104
104
  }, /*#__PURE__*/_react["default"].createElement(_dataCatalogComponents.DataTablePageResults, {
105
- totalRows: intCount,
106
- limit: limit,
107
- offset: offset
105
+ totalRows: parseInt(intCount),
106
+ limit: parseInt(limit),
107
+ offset: parseInt(offset)
108
108
  })), /*#__PURE__*/_react["default"].createElement("div", {
109
109
  className: "dc-c-resource-header--buttons"
110
110
  }, includeDownload && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_designSystem.Button, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@civicactions/cmsds-open-data-components",
3
- "version": "1.13.0-alpha.2",
3
+ "version": "1.13.0-beta.1",
4
4
  "description": "Components for the open data catalog frontend using CMS Design System",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {