Skip to content

Commit

Permalink
Remove deprecated store methods from test
Browse files Browse the repository at this point in the history
No longer needed
  • Loading branch information
surchs committed Dec 1, 2023
1 parent c31bfe6 commit 86c0abf
Showing 1 changed file with 12 additions and 32 deletions.
44 changes: 12 additions & 32 deletions cypress/component/next-page.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,6 @@ describe("next page button", () => {

commit: () => {},

getters: {

getNextPage: () => {

return "mynextpage";
}
},

mutations: {

setCurrentPage: () => (p_pageName) => {

store.state.currentPage = p_pageName;
}
},

state: {

currentPage: "mypage",
Expand All @@ -46,13 +30,12 @@ describe("next page button", () => {

it("Does instruction text appear above the next page button when the button is disabled", () => {

// Setup - The next page after 'mypage' is currently inaccessible
store.getters.isPageAccessible = () => (p_pageName) => false;

// Act - Mount the next page button with mocks
cy.mount(nextPage, {

computed: store.getters,
computed: {
isPageAccessible: () => (p_pageName) => false
},
data() {
return {
uiText: uiText
Expand All @@ -72,13 +55,12 @@ describe("next page button", () => {

it("Button is enabled when next page is accessible and vice-versa", () => {

// Setup - Mock the page accessibility getter to test effects on the next page button
store.getters.isPageAccessible = () => (p_pageName) => true;

// Act - Mount the next page button with mocks
cy.mount(nextPage, {

computed: store.getters,
computed: {
isPageAccessible: () => (p_pageName) => true
},
data() {
return {
uiText: uiText
Expand All @@ -98,13 +80,12 @@ describe("next page button", () => {

it("Button is disabled when next page is not accessible", () => {

// Setup - Mock the page accessibility getter to test effects on the next page button
store.getters.isPageAccessible = () => (p_pageName) => false;

// Act - Mount the next page button with mocks
cy.mount(nextPage, {

computed: store.getters,
computed: {
isPageAccessible: () => (p_pageName) => false
},
data() {
return {
uiText: uiText
Expand All @@ -124,13 +105,12 @@ describe("next page button", () => {

it("Does the label on the next page button correspond to the text for the current page?", () => {

// Setup - Mock the page accessibility getter to test effects on the next page button
store.getters.isPageAccessible = () => (p_pageName) => true;

// Act - Mount the next page button with mocks
cy.mount(nextPage, {

computed: store.getters,
computed: {
isPageAccessible: () => (p_pageName) => true
},
data() {
return {
uiText: uiText
Expand Down

0 comments on commit 86c0abf

Please sign in to comment.