-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the export wins moved banner only appear on the Export tab
- Loading branch information
1 parent
de2c09d
commit 43ca93e
Showing
2 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
test/functional/cypress/specs/companies/export-wins-moved-spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
const { company } = require('../../fixtures') | ||
const urls = require('../../../../../src/lib/urls') | ||
|
||
describe('Export wins moved banner', () => { | ||
it('There should be a banner informing about export wins moving to Data Hub on the company page', () => { | ||
cy.visit(urls.companies.exports.index(company.dnbCorp.id)) | ||
|
||
cy.get('[data-test="status-message"') | ||
.should( | ||
'have.text', | ||
'Historic export wins have now moved to Data Hub, see the export wins announcement.' | ||
) | ||
.within(() => { | ||
cy.contains('a', 'see the export wins announcement').should( | ||
'have.attr', | ||
'href', | ||
'https://data-services-help.trade.gov.uk/data-hub/updates/announcements/export-wins-has-moved-to-data-hub/' | ||
) | ||
}) | ||
}) | ||
|
||
describe("There should't be a banner in the other tabs", () => { | ||
;[ | ||
'overview', | ||
'activity', | ||
'business-details', | ||
'contacts', | ||
'account-management', | ||
'investments/projects', | ||
'orders', | ||
].forEach((slug) => | ||
it(slug, () => { | ||
cy.visit(`/companies/${company.dnbCorp.id}/${slug}`) | ||
|
||
// We need to wait for company name appear... | ||
cy.contains(company.dnbCorp.name) | ||
|
||
// ...so that this waits for whent the data has been loaded and rendered | ||
cy.contains('Historic export wins have now moved to Data Hub').should( | ||
'not.exist' | ||
) | ||
}) | ||
) | ||
}) | ||
}) |