Skip to content

Commit

Permalink
Plugin tests passing.
Browse files Browse the repository at this point in the history
  • Loading branch information
nataliecarey committed Sep 8, 2023
1 parent d2e3886 commit 66e55bd
Show file tree
Hide file tree
Showing 11 changed files with 214 additions and 163 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ describe('Install and uninstall Local Plugin via UI Test', async () => {

cy.get(panelCompleteQuery, { timeout: 20000 })
.should('be.visible')
cy.get('a').contains('Back to plugin details')

// ------------------------

Expand All @@ -60,10 +59,12 @@ describe('Install and uninstall Local Plugin via UI Test', async () => {

performPluginAction('uninstall', dependentPlugin, dependentPluginName)

waitForApplication()

// ------------------------

log(`The ${dependentPlugin} plugin templates are not available`)
cy.get('a').contains('Templates').click()
cy.visit('http://localhost:3000/manage-prototype/templates', { retryOnNetworkFailure: true, timeout: 4000 })
cy.get(`[data-plugin-package-name="${dependentPlugin}"]`).should('not.exist')
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('Handle a plugin update', () => {
.contains('Update')
.click()

cy.get('#plugin-action-confirmation', { timeout: 4000 })
cy.get('#dependency-heading', { timeout: 4000 })
.find('ul')
.contains(dependencyPluginName)

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/plugins/plugin-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async function loadTemplatesPage () {

function performPluginAction (action, plugin, pluginName) {
cy.task('log', `The ${plugin} plugin should be displayed`)
cy.get('h2')
cy.get('h1')
.contains(pluginName)

const processingText = `${action === 'update' ? 'Updat' : action}ing ...`
Expand Down
1 change: 0 additions & 1 deletion known-plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"hmrc-frontend",
"jquery",
"notifications-node-client",
"@hmcts/frontend",
"@ministryofjustice/frontend",
"@x-govuk/edit-prototype-in-browser",
"@x-govuk/govuk-prototype-components",
Expand Down
2 changes: 1 addition & 1 deletion lib/assets/javascripts/manage-prototype/manage-plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@

hide('panel-manual-instructions')
const actionButton = document.getElementById('plugin-action-button')
const previousRun = window.localStorage.getItem(localStorageKey)
const previousRun = localStorageKey && window.localStorage.getItem(localStorageKey)

if (previousRun) {
console.log('previous state exists')
Expand Down
2 changes: 1 addition & 1 deletion lib/manage-prototype-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ async function getPluginsModeHandler (req, res, next) {

if (relatedPlugins.length > 0) {
const plural = relatedPlugins.length > 1
dependencyHeading = `To ${mode} this plugin, you'll also need to ${mode === 'update' ? 'install' : mode} ${(plural ? 'other plugins' : 'another plugin')}`
dependencyHeading = `To ${mode} this plugin, you also need to ${mode === 'update' ? 'install' : mode} ${(plural ? 'other plugins' : 'another plugin')}`
}

res.render(getManagementView('plugin-install-or-uninstall.njk'), {
Expand Down
2 changes: 1 addition & 1 deletion lib/nunjucks/views/error-handling/server-error.njk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "govuk-prototype-kit/layouts/govuk-branded.njk" %}
{% extends "views/manage-prototype/layout.njk" %}

{% block pageTitle %}
Error {% if serviceName %}{{ serviceName }}{% endif %} – GOV.UK Prototype Kit
Expand Down
3 changes: 2 additions & 1 deletion lib/plugins/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ const knownWordsToFormat = {
ons: 'ONS',
jquery: 'jQuery',
dwp: 'DWP',
tpr: 'TPR'
tpr: 'TPR',
ministryofjustice: 'Ministry of Justice'
}

function prepareWordForPackageNameDisplay (word) {
Expand Down
Loading

0 comments on commit 66e55bd

Please sign in to comment.