feat: add nomcom questionnaires tabs tests

Commit ready for merge.
 - Legacy-Id: 19698
This commit is contained in:
nick 2021-11-22 19:34:22 +00:00
parent 8ab1408b66
commit b98c7ec3bd
4 changed files with 34 additions and 15 deletions

View file

@ -58,18 +58,19 @@
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"ms-azuretools.vscode-docker",
"editorconfig.editorconfig",
"redhat.vscode-yaml",
"visualstudioexptteam.vscodeintellicode",
"batisteo.vscode-django",
"mutantdino.resourcemonitor",
"spmeesseman.vscode-taskexplorer",
"mtxr.sqltools",
"mtxr.sqltools-driver-mysql"
],
"ms-python.python",
"ms-python.vscode-pylance",
"ms-azuretools.vscode-docker",
"editorconfig.editorconfig",
"redhat.vscode-yaml",
"visualstudioexptteam.vscodeintellicode",
"batisteo.vscode-django",
"mutantdino.resourcemonitor",
"spmeesseman.vscode-taskexplorer",
"mtxr.sqltools",
"mtxr.sqltools-driver-mysql",
"mrmlnc.vscode-duplicate"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8000, 3306],

View file

@ -1,6 +1,6 @@
/// <reference types="cypress" />
describe('nomcom', () => {
describe('expertise', () => {
before(() => {
cy.visit('/nomcom/2021/expertise/')
})

View file

@ -0,0 +1,18 @@
/// <reference types="cypress" />
describe('questionnaires', () => {
before(() => {
cy.visit('/nomcom/2021/questionnaires/')
})
it('position tabs should display the appropriate panel on click', () => {
cy.get('.nomcom-questnr-positions-tabs > li > a').each($tab => {
cy.wrap($tab).click()
cy.wrap($tab).parent().should('have.class', 'active')
cy.wrap($tab).invoke('attr', 'href').then($tabId => {
cy.get($tabId).should('have.class', 'tab-pane').and('have.class', 'active').and('be.visible')
})
})
})
})

View file

@ -8,7 +8,7 @@
{% origin %}
<h2>Questionnaires</h2>
<ul class="nav nav-tabs" role="tablist">
<ul class="nomcom-questnr-positions-tabs nav nav-tabs" role="tablist">
{% for position in positions %}
<li {% if forloop.first %}class="active"{% endif %}>
<a data-toggle="tab" role="tab" href="#{{ position.name|slugify }}">{{ position.name }}</a>
@ -16,7 +16,7 @@
{% endfor %}
</ul>
<div class="tab-content">
<div class="nomcom-questnr-positions-content tab-content">
{% for position in positions %}
<div class="tab-pane {% if forloop.first %}active{% endif %}" id="{{ position.name|slugify }}">
{{ position.get_questionnaire|linebreaks}}