Skip to content

Commit

Permalink
Using stubs in tests (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
janette authored Sep 22, 2020
1 parent 54d98ab commit 44c7e07
Show file tree
Hide file tree
Showing 9 changed files with 1,324 additions and 500 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- run:
name: Create DKAN site with frontend; run tests
command: |
dktl init
dktl init --dkan=2.x-dev
dktl make
dktl install
dktl install:sample
Expand Down
104 changes: 73 additions & 31 deletions cypress/fixtures/datasetMetadata.json
Original file line number Diff line number Diff line change
@@ -1,67 +1,109 @@
{
"@type": "dcat:Dataset",
"accessLevel": "public",
"accrualPeriodicity": "R/PT1S",
"contactPoint": {
"fn": "Gray, Stefanie",
"hasEmail": "mailto:datademo@example.com"
"fn": "Jane Doe",
"hasEmail": "mailto:data.admin@example.com"
},
"description": "<p>Monthly gold prices (USD) in London from Bundesbank.</p>\n<p>General: 1 ounce of fine gold = 31.1034768g.</p>\n<p>Method of calculation:</p>\n<ul><li>Since 1 April 1968, calculated from the daily morning fixing;</li>\n<li>From January 1950 to 21 March 1954, calculated using the Bank of England's gold purchasing price (1 ounce of fine = pound 12.40) in connection with the average exchange rate for the pound in New York (up to the end of 1952; source: Federal Reserve Bulletin) and, from January 1953, midpoint exchange rates for the US dollar in London (source: Financial Times (FT)).</li>\n<li>From 22 March 1954 to December 1959, calculated using the fixing price for gold bars of approx. 12 1/2 kg and 995/1000 fineness and over (so-called standard bars) according to data from Metallgesellschaft AG, Frankfurt am Main, in connection with the average midpoint exchange rates for the US dollar in London (source: FT).</li>\n<li>From January 1960 to 14 March 1968, average fixing price for standard bars as specified in the Bank of England's Quarterly Bulletin.</li>\n<li>On 15 March 1968, fixing price suspended. Gold market split into an official (reserved for central banks) and a free market as a result of the Washington Communique of 17 March 1968. Gold trading suspended from 18 to 29 March 1968.</li>\n<li>Sources for daily prices: April 1968 - March 1974: FT; April 1974 - December 1980: Samuel Montagu &amp; Co. Ltd.; January 1981 - December 2005: FT; January 2006 - present: Reuters.</li>\n<li>Comment on 1968-03: Average from 1 to 14 March 1968.</li>\n</ul><p>License: PDDL (Source indicates no restrictions on data).</p>\n",
"description": "This table contains the estimated percent of California adults (18 and older) with lifetime and current asthma (asthma prevalence), by year.",
"distribution": [
{
"identifier": "1234abcd",
"data": {
"@type": "dcat:Distribution",
"downloadURL": "http://demo.getdkan.org/sites/default/files/distribution/5dc1cfcf-8028-476c-a020-f58ec6dd621c/data_0.csv",
"downloadURL": "http://dkan.localtest.me/sites/default/files/distribution/95f8eac4-fd1f-4b35-8472-5c87e9425dfa/asthma-prevalence-adults-by-year-1945-to-1999.csv",
"mediaType": "text/csv",
"format": "csv",
"description": "<p>CSV file extracted and cleaned from source excel.</p>\n<p>Click on Graph button under Preview and plot date (x-axis) against price (y-axis) to see a line graph. Hovering over a point gives you the value of that data entry.</p>\n",
"title": "Table of Gold Prices"
"description": "Mock data for demonstration purposes.",
"title": "Data-Adult Asthma Prevalence 1945 to 1999",
"%Ref:downloadURL": [
{
"identifier": "26b78330a581458b59bf25b434b5ea56__1600709122__source",
"data": {
"filePath": "http://h-o.st/sites/default/files/distribution/95f8eac4-fd1f-4b35-8472-5c87e9425dfa/asthma-prevalence-adults-by-year-1945-to-1999.csv",
"identifier": "26b78330a581458b59bf25b434b5ea56",
"mimeType": "text/csv",
"perspective": "source",
"version": "1600709122"
}
}
]
}
},
{
"identifier": "d53e8bf7-627c-511e-8d69-aae1f7d5e0e7",
"identifier": "2a6924b6-f8bb-5c85-93d8-1744fa1e2093",
"data": {
"@type": "dcat:Distribution",
"downloadURL": "http://demo.getdkan.org/sites/default/files/distribution/fb3525f2-d32a-451e-8869-906ed41f7695/IMD-MAPS.zip",
"mediaType": "application/zip",
"format": "zip",
"title": "English Indices of Deprivation 2010"
"downloadURL": "http://dkan.localtest.me/sites/default/files/distribution/95f8eac4-fd1f-4b35-8472-5c87e9425dfa/asthma-prevalence-adults-by-year-2000-to-2020.csv",
"mediaType": "text/csv",
"format": "csv",
"description": "Mock data for demonstration purposes.",
"title": "Data-Adult Asthma Prevalence 2000 to 2020",
"%Ref:downloadURL": [
{
"identifier": "37b4a12f517e8f19b39e45d185cb26cc__1600709122__source",
"data": {
"filePath": "http://h-o.st/sites/default/files/distribution/95f8eac4-fd1f-4b35-8472-5c87e9425dfa/asthma-prevalence-adults-by-year-2000-to-2020.csv",
"identifier": "37b4a12f517e8f19b39e45d185cb26cc",
"mimeType": "text/csv",
"perspective": "source",
"version": "1600709122"
}
}
]
}
},
{
"identifier": "18665dfe-b31e-5ccf-9325-97c9833c6804",
"data": {
"@type": "dcat:Distribution",
"downloadURL": "http://dkan.localtest.me/sites/default/files/distribution/95f8eac4-fd1f-4b35-8472-5c87e9425dfa/lifetime-asthma-prevalence-by-county_data-dictionary.xlsx",
"mediaType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"format": "xlsx",
"title": "Data Dictionary Data-Lifetime Asthma Prevalence",
"%Ref:downloadURL": [
{
"identifier": "6aec2388ca0bb4d8e70bab84f4e0bac2__1600709122__source",
"data": {
"filePath": "http://h-o.st/sites/default/files/distribution/95f8eac4-fd1f-4b35-8472-5c87e9425dfa/lifetime-asthma-prevalence-by-county_data-dictionary.xlsx",
"identifier": "6aec2388ca0bb4d8e70bab84f4e0bac2",
"mimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"perspective": "source",
"version": "1600709122"
}
}
]
}
}
],
"identifier": "5dc1cfcf-8028-476c-a020-f58ec6dd621c",
"issued": "2013-02-10",
"identifier": "95f8eac4-fd1f-4b35-8472-5c87e9425dfa",
"issued": "2017-08-01",
"keyword": [
{
"identifier": "cf43cf96-f037-516f-974d-4330bcdbc1f9",
"data": "economy"
},
{
"identifier": "476d534b-e212-504d-82c9-5d21df655329",
"data": "price"
"identifier": "2d2fb90b-c0d3-5292-b2fe-68a13e42c76f",
"data": "health"
},
{
"identifier": "88232224-58d8-5dec-8cf3-e38426566501",
"data": "time-series"
"identifier": "5f0f72cb-fd04-5f13-8a3a-44aaae62b165",
"data": "asthma"
}
],
"license": "http://opendefinition.org/licenses/odc-pddl/",
"license": "http://opendefinition.org/licenses/odc-odbl/",
"modified": "2019-06-06",
"publisher": {
"identifier": "c43b40ae-b279-58ed-91c8-065966b36fe8",
"identifier": "806cb23a-6c56-532a-ae96-b27cf7499090",
"data": {
"@type": "org:Organization",
"name": "State Economic Council"
"name": "National Health Council"
}
},
"spatial": "POLYGON ((-0.56854248046875 51.253320526331, -0.56854248046875 51.725326868065, 0.3076171875 51.725326868065, 0.3076171875 51.253320526331))",
"temporal": "1950-01-01T05:00:00+00:00/1950-01-01T05:00:00+00:00",
"theme": [
{
"identifier": "b1f822b6-ae46-584d-9268-52ca95a3f8ec",
"data": "Finance and Budgeting"
"identifier": "ebea68c6-14b5-5a68-ac94-955e69666ad7",
"data": "Health Care"
}
],
"title": "Gold Prices in London 1950-2008 (Monthly)",
"%modified": "2020-09-15"
}
"temporal": "1995-01-01T05:00:00+00:00/2017-12-31T05:00:00+00:00",
"title": "Asthma Prevalence"
}
37 changes: 16 additions & 21 deletions cypress/fixtures/searchFacets.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{
"type": "theme",
"name": "Finance and Budgeting",
"total": "4"
"total": "3"
},
{
"type": "theme",
Expand All @@ -23,46 +23,41 @@
{
"type": "theme",
"name": "Health Care",
"total": "2"
"total": "3"
},
{
"type": "keyword",
"name": "hello",
"name": "bike-lanes",
"total": "1"
},
{
"type": "keyword",
"name": "goodbye",
"name": "streets",
"total": "1"
},
{
"type": "keyword",
"name": "yep",
"name": "infrastructure",
"total": "1"
},
{
"type": "keyword",
"name": "blah",
"name": "foreclosures",
"total": "1"
},
{
"type": "keyword",
"name": "demographics",
"total": "3"
},
{
"type": "keyword",
"name": "economy",
"total": "3"
},
{
"type": "keyword",
"name": "spatial data",
"name": "affordable-housing",
"total": "1"
},
{
"type": "keyword",
"name": "United Kingdom",
"name": "housing-markets",
"total": "1"
},
{
Expand All @@ -72,23 +67,23 @@
},
{
"type": "keyword",
"name": "public safety",
"name": "city",
"total": "1"
},
{
"type": "keyword",
"name": "socioeconomic",
"total": "1"
"name": "health",
"total": "3"
},
{
"type": "keyword",
"name": "workforce",
"name": "asthma",
"total": "1"
},
{
"type": "keyword",
"name": "health",
"total": "2"
"name": "demographics",
"total": "1"
},
{
"type": "keyword",
Expand Down Expand Up @@ -127,12 +122,12 @@
},
{
"type": "publisher__name",
"name": "Committee on International Affairs",
"name": "National Health Council",
"total": "3"
},
{
"type": "publisher__name",
"name": "Advisory Council for Infectious Disease",
"name": "Committee on International Affairs",
"total": "2"
}
]
Expand Down
Loading

0 comments on commit 44c7e07

Please sign in to comment.