Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
583a19f
Doing tests on open-design
simon332114 Feb 18, 2020
c7ee3b4
Still working on it
simon332114 Feb 18, 2020
4b383fa
Fix input test
simon332114 Feb 18, 2020
f460959
Merge branch 'master' into open-design-tests
simon332114 Feb 18, 2020
7db85ce
Lightboxes test never
simon332114 Feb 18, 2020
ee10c04
Continuing tests
simon332114 Feb 18, 2020
778debb
Fix designSelect for french page + more tests
simon332114 Feb 19, 2020
7ed391a
Design select tested
simon332114 Feb 19, 2020
0cc203b
Started reset test and finished fill test
simon332114 Feb 19, 2020
f92147c
Reset test done
simon332114 Feb 19, 2020
7c47db5
Test for designSelect change
simon332114 Feb 19, 2020
297a2d5
Cleanup
simon332114 Feb 19, 2020
f6a7464
Working on design table test
simon332114 Feb 19, 2020
3c15a4f
Modal lightbox test works
simon332114 Feb 19, 2020
c1372fb
Moved tests to more right spec file
simon332114 Feb 19, 2020
cc62e64
Added licences.spec.js and more design tests
simon332114 Feb 20, 2020
1fdd3de
more design form tests and clarified context fields
simon332114 Feb 20, 2020
27fa979
Reorganised design form tests and started submission tests
simon332114 Feb 20, 2020
83a0e68
Fixed submit test
simon332114 Feb 20, 2020
cc7cd05
Fixed test
simon332114 Feb 20, 2020
64da726
Submit test finally works
simon332114 Feb 21, 2020
7e9b843
The submit test is still sending things when it shouldn't
simon332114 Feb 21, 2020
270fd97
Disabling it for now
simon332114 Feb 21, 2020
fded708
Fixed submit test
simon332114 Mar 12, 2020
dc463bb
Merge branch 'master' into open-design-tests
simon332114 Mar 24, 2020
cb21699
Added URL constant
simon332114 Mar 25, 2020
a366e23
Changed form test contexts
simon332114 Apr 27, 2020
7bb85bf
Fixed submission test by calling the submitInit method directly
simon332114 Apr 30, 2020
0f00d78
Removed form submission entirely since the test concerns validation
simon332114 Apr 30, 2020
42a1128
Merge https://github.com/canada-ca/ore-ero into open-design-tests
simon332114 Apr 30, 2020
d7f2667
Before lint is runs on it and crashes it
simon332114 Apr 30, 2020
6f9a51f
Merge branch 'master' into open-design-tests
simon332114 May 6, 2020
f02d0f3
Added to the CI build
simon332114 May 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,10 @@ jobs:

- name: Run HTML5 Validator
run: html5validator --root _site/

- name: Serve with jekyll
run: bundle exec jekyll serve
Comment thread
nschonni marked this conversation as resolved.

- name: Cypress
run: npm run cypress

4 changes: 2 additions & 2 deletions _includes/form/presets/selectDesign.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
{%- assign group = "select" -%}
{%- assign design_arr = "" | split: ',' -%}
{%- for design in site.data.design -%}
{%- assign design_arr = design_arr | push: design[1].name[page.lang] -%}
{%- assign design_arr = design_arr | push: design[1] -%}
{%- endfor %}
{%- assign design_arr = design_arr | sort_natural -%}
<div class="form-group">
{% include form/components/label-group.html id=include.id title=title group=group param=site.data.forms.param.required_false %}
<select class="form-control" id="{{ title }}{{ group }}" name="{{ title }}{{ group }}">
<option value="">&nbsp;</option>
{%- for design in design_arr -%}
<option value="{{ design | slugify }}">{{ design }}</option>
<option value="{{ design.name.en | slugify }}">{{ design.name[page.lang] }}</option>
{%- endfor -%}
</select>
</div>
Expand Down
2 changes: 1 addition & 1 deletion _pages/en/open-design.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
permalink: /en/open-design.html
---

<h1 property="name" id="wb-cont">Open Design Resources</h1>
<h1 property="name" id="wb-cont">Open Designs</h1>
<p>Open design refers to a design for a physical or software product released under a license granting anyone permission to use, modify or redistribute it.</p>
<p>Search the catalog for open design resource by different levels of Canadian public .</p>
<p>You may also <strong>add</strong> a resource or <strong>update</strong> its data using using the <a href="./open-design-form.html">Open Design Resource Form</a>.</p>
Expand Down
2 changes: 1 addition & 1 deletion _pages/fr/design-libre.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
permalink: /fr/design-libre.html
---

<h1 property="name" id="wb-cont">Design libres</h1>
<h1 property="name" id="wb-cont">Designs Libres</h1>
<p>Un design libre est un design, que ce soit pour un produit physique ou un logiciel, dont le développement suit un processus semblable au code et logiciel libre. La licence du design permet d’y accéder librement, de créer des travaux dérivés, de modifier le design et de le redistribuer.</p>
<p>Consultez la liste des designs libres utilisés par les administrations publiques canadiennes.</p>
<p>Vous pouvez <strong>ajouter</strong> un design ou <strong>modifier</strong> ses informations en utilisant le <a href="./design-libre-formulaire.html">Formulaire de Design Libre</a>.</p>
Expand Down
6 changes: 4 additions & 2 deletions assets/js/src/designForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

const designSelect = $('.page-designForm #nameselect');
const adminSelect = $('.page-designForm #adminCode');
const URL = document.defaultView.location.origin +
(document.defaultView.location.protocol == "http:" ? "/ore-ero" : "");

$(document).ready(function () {
$('#prbotSubmitdesignForm').click(function () {
Expand Down Expand Up @@ -408,7 +410,7 @@ function getConfigNew(designObject, file, ProjectName) {

function selectDesign() {
let value = designSelect.val();
$.getJSON('../design.json', function (result) {
$.getJSON(URL + '/design.json', function (result) {
if (result[value]) {
addValueToFieldsDesign(result[value]);
$('#adminCode').focus();
Expand Down Expand Up @@ -458,7 +460,7 @@ function resetFieldsDesign() {
function selectAdmin() {
let design = designSelect.val();
let administration = adminSelect.val();
$.getJSON('../design.json', function (result) {
$.getJSON(URL + '/design.json', function (result) {
if (result[design]) {
for (let i = 0; i < result[design].administrations.length; i++) {
if (result[design].administrations[i].adminCode == administration) {
Expand Down
1 change: 1 addition & 0 deletions assets/js/src/designType.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ function fillTypeFields(designTypes) {
}
$('#designType' + id).val(designType.type.en);
});

}

function addType(index) {
Expand Down
4 changes: 4 additions & 0 deletions assets/js/src/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@ function submitInit() {
}
return valid;
}
//Allows use of the function for testing so there isn't any real submission happening
window.submit_init = {
submitInit,
};
18 changes: 18 additions & 0 deletions cypress/integration/unit-tests/licences.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
context('Licences', () => {
it ('addMorelicences button should add an element to the list and show the removeMorelicences button', () => {
cy.visit('http://localhost:4000/ore-ero/en/open-design-form.html');
cy.get('#addMorelicences').find('.btn-tabs-more').click();
cy.get('#addMorelicences').find('ul > li').should('have.length', 2);
cy.get('#addMorelicences').find('.btn-tabs-more-remove').should('be.visible');
});
it ('removeMorelicences button should remove an item from the list and disappear', () => {
cy.get('#addMorelicences').find('.btn-tabs-more-remove').click();
cy.get('#addMorelicences').find('ul > li').should('have.length', 1);
cy.get('#addMorelicences').find('.btn-tabs-more-remove').should('be.hidden');
});

it ('There should be available licence options', () => {
cy.visit('http://localhost:4000/ore-ero/en/open-design-form.html');
cy.get('#licencesspdxID').children().should('have.length.greaterThan', 1);
});
});
Loading