From 86d54d17ccbc9dce846b4275dd086b6b0efd1782 Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Thu, 11 Jul 2024 03:58:09 +0000 Subject: [PATCH 1/8] fix(fixtures): remove sbmtd --- benefits/core/migrations/local_fixtures.json | 109 ------------------- 1 file changed, 109 deletions(-) diff --git a/benefits/core/migrations/local_fixtures.json b/benefits/core/migrations/local_fixtures.json index 4ea7cc35e..11b0493df 100644 --- a/benefits/core/migrations/local_fixtures.json +++ b/benefits/core/migrations/local_fixtures.json @@ -8,15 +8,6 @@ "remote_url": "https://raw.githubusercontent.com/cal-itp/eligibility-server/main/keys/server.pub" } }, - { - "model": "core.pemdata", - "pk": 2, - "fields": { - "label": "(SBMTD) eligibility server public key", - "text_secret_name": null, - "remote_url": "https://raw.githubusercontent.com/cal-itp/eligibility-server/main/keys/server.pub" - } - }, { "model": "core.pemdata", "pk": 3, @@ -104,27 +95,6 @@ "enrollment_success_template": "enrollment/success--sacrt.html" } }, - { - "model": "core.eligibilitytype", - "pk": 5, - "fields": { - "name": "senior", - "label": "(SBMTD) Senior Discount", - "group_id": "group123", - "enrollment_success_template": "enrollment/success--sbmtd.html" - } - }, - { - "model": "core.eligibilitytype", - "pk": 6, - "fields": { - "name": "mobility_pass", - "label": "(SBMTD) Mobility Pass Discount", - "group_id": "group123", - "enrollment_index_template": "enrollment/index--agency-card.html", - "enrollment_success_template": "enrollment/success--sbmtd-mobility-pass.html" - } - }, { "model": "core.eligibilitytype", "pk": 7, @@ -225,50 +195,6 @@ "form_class": null } }, - { - "model": "core.eligibilityverifier", - "pk": 5, - "fields": { - "name": "(SBMTD) oauth claims via Login.gov", - "display_order": 6, - "active": false, - "api_url": null, - "api_auth_header": null, - "api_auth_key_secret_name": null, - "eligibility_type": 5, - "public_key": null, - "jwe_cek_enc": null, - "jwe_encryption_alg": null, - "jws_signing_alg": null, - "auth_provider": 1, - "selection_label_template": "eligibility/includes/selection-label--senior.html", - "start_template": "eligibility/start--senior.html", - "form_class": null - } - }, - { - "model": "core.eligibilityverifier", - "pk": 6, - "fields": { - "name": "(SBMTD) eligibility server verifier", - "display_order": 7, - "active": true, - "api_url": "http://server:8000/verify", - "api_auth_header": "X-Server-API-Key", - "api_auth_key_secret_name": "mobility-pass-verifier-api-auth-key", - "eligibility_type": 6, - "public_key": 2, - "jwe_cek_enc": "A256CBC-HS512", - "jwe_encryption_alg": "RSA-OAEP", - "jws_signing_alg": "RS256", - "auth_provider": null, - "selection_label_template": "eligibility/includes/selection-label--sbmtd-mobility-pass.html", - "start_template": "eligibility/start--sbmtd-mobility-pass.html", - "form_class": "benefits.eligibility.forms.SBMTDMobilityPass", - "unverified_template": "eligibility/unverified--sbmtd-mobility-pass.html", - "help_template": "core/includes/help--sbmtd-mobility-pass.html" - } - }, { "model": "core.eligibilityverifier", "pk": 7, @@ -319,20 +245,6 @@ "card_tokenize_env": "test" } }, - { - "model": "core.paymentprocessor", - "pk": 3, - "fields": { - "name": "(SBMTD) test payment processor", - "api_base_url": "http://server:8000", - "client_id": "", - "client_secret_name": "sbmtd-payment-processor-client-secret", - "audience": "", - "card_tokenize_url": "http://server:8000/static/tokenize.js", - "card_tokenize_func": "tokenize", - "card_tokenize_env": "test" - } - }, { "model": "core.transitagency", "pk": 1, @@ -374,26 +286,5 @@ "eligibility_types": [4], "eligibility_verifiers": [4] } - }, - { - "model": "core.transitagency", - "pk": 3, - "fields": { - "slug": "sbmtd", - "short_name": "SBMTD (local)", - "long_name": "Santa Barbara MTD (local)", - "agency_id": "sbmtd", - "info_url": "https://sbmtd.gov/taptoride/", - "phone": "805-963-3366", - "active": true, - "payment_processor": 3, - "private_key": 3, - "public_key": 4, - "jws_signing_alg": "RS256", - "index_template": "core/index--sbmtd.html", - "eligibility_index_template": "eligibility/index--sbmtd.html", - "eligibility_types": [5, 6], - "eligibility_verifiers": [5, 6] - } } ] From d62228c698ecbc39e98aa4f00df0336b84237e91 Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Thu, 11 Jul 2024 04:00:54 +0000 Subject: [PATCH 2/8] fix(fixtures): remove sacrt --- benefits/core/migrations/local_fixtures.json | 66 -------------------- 1 file changed, 66 deletions(-) diff --git a/benefits/core/migrations/local_fixtures.json b/benefits/core/migrations/local_fixtures.json index 11b0493df..c85304b4c 100644 --- a/benefits/core/migrations/local_fixtures.json +++ b/benefits/core/migrations/local_fixtures.json @@ -85,16 +85,6 @@ "enrollment_success_template": "enrollment/success--mst-courtesy-card.html" } }, - { - "model": "core.eligibilitytype", - "pk": 4, - "fields": { - "name": "senior", - "label": "(SacRT) Senior Discount", - "group_id": "group123", - "enrollment_success_template": "enrollment/success--sacrt.html" - } - }, { "model": "core.eligibilitytype", "pk": 7, @@ -174,27 +164,6 @@ "help_template": "core/includes/help--mst-courtesy-card.html" } }, - { - "model": "core.eligibilityverifier", - "pk": 4, - "fields": { - "name": "(SacRT) oauth claims via Login.gov", - "display_order": 5, - "active": false, - "api_url": null, - "api_auth_header": null, - "api_auth_key_secret_name": null, - "eligibility_type": 4, - "public_key": null, - "jwe_cek_enc": null, - "jwe_encryption_alg": null, - "jws_signing_alg": null, - "auth_provider": 1, - "selection_label_template": "eligibility/includes/selection-label--senior.html", - "start_template": "eligibility/start--senior.html", - "form_class": null - } - }, { "model": "core.eligibilityverifier", "pk": 7, @@ -231,20 +200,6 @@ "card_tokenize_env": "test" } }, - { - "model": "core.paymentprocessor", - "pk": 2, - "fields": { - "name": "(SacRT) test payment processor", - "api_base_url": "http://server:8000", - "client_id": "", - "client_secret_name": "sacrt-payment-processor-client-secret", - "audience": "", - "card_tokenize_url": "http://server:8000/static/tokenize.js", - "card_tokenize_func": "tokenize", - "card_tokenize_env": "test" - } - }, { "model": "core.transitagency", "pk": 1, @@ -265,26 +220,5 @@ "eligibility_types": [1, 7, 2, 3], "eligibility_verifiers": [1, 7, 2, 3] } - }, - { - "model": "core.transitagency", - "pk": 2, - "fields": { - "slug": "sacrt", - "short_name": "SacRT (local)", - "long_name": "Sacramento Regional Transit (local)", - "agency_id": "sacrt", - "info_url": "https://sacrt.com/", - "phone": "916-321-2877", - "active": true, - "payment_processor": 2, - "private_key": 3, - "public_key": 4, - "jws_signing_alg": "RS256", - "index_template": "core/index--sacrt.html", - "eligibility_index_template": "eligibility/index--sacrt.html", - "eligibility_types": [4], - "eligibility_verifiers": [4] - } } ] From d7502bb1376a801050833e6e39293691e96aaf14 Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Thu, 11 Jul 2024 04:17:12 +0000 Subject: [PATCH 3/8] fix(fixtures): change mst to cst --- benefits/core/migrations/local_fixtures.json | 58 ++++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/benefits/core/migrations/local_fixtures.json b/benefits/core/migrations/local_fixtures.json index c85304b4c..be917a8c2 100644 --- a/benefits/core/migrations/local_fixtures.json +++ b/benefits/core/migrations/local_fixtures.json @@ -3,7 +3,7 @@ "model": "core.pemdata", "pk": 1, "fields": { - "label": "(MST) eligibility server public key", + "label": "(CST) eligibility server public key", "text_secret_name": null, "remote_url": "https://raw.githubusercontent.com/cal-itp/eligibility-server/main/keys/server.pub" } @@ -59,9 +59,9 @@ "pk": 1, "fields": { "name": "senior", - "label": "(MST) Senior Discount", + "label": "(CST) Senior Discount", "group_id": "group123", - "enrollment_success_template": "enrollment/success--mst.html" + "enrollment_success_template": "enrollment/success--cst.html" } }, { @@ -69,20 +69,20 @@ "pk": 2, "fields": { "name": "veteran", - "label": "(MST) Veteran Discount", + "label": "(CST) Veteran Discount", "group_id": "group123", - "enrollment_success_template": "enrollment/success--mst.html" + "enrollment_success_template": "enrollment/success--cst.html" } }, { "model": "core.eligibilitytype", "pk": 3, "fields": { - "name": "courtesy_card", - "label": "(MST) Courtesy Card Discount", + "name": "agency_card", + "label": "(CST) Agency Card Discount", "group_id": "group123", "enrollment_index_template": "enrollment/index--agency-card.html", - "enrollment_success_template": "enrollment/success--mst-courtesy-card.html" + "enrollment_success_template": "enrollment/success--cst-agency-card.html" } }, { @@ -96,14 +96,14 @@ "expiration_days": 5, "expiration_reenrollment_days": 3, "reenrollment_error_template": "enrollment/reenrollment-error--calfresh.html", - "enrollment_success_template": "enrollment/success--mst.html" + "enrollment_success_template": "enrollment/success--cst.html" } }, { "model": "core.eligibilityverifier", "pk": 1, "fields": { - "name": "(MST) oauth claims via Login.gov", + "name": "(CST) oauth claims via Login.gov", "display_order": 1, "active": true, "api_url": null, @@ -124,7 +124,7 @@ "model": "core.eligibilityverifier", "pk": 2, "fields": { - "name": "(MST) VA.gov - veteran", + "name": "(CST) VA.gov - veteran", "display_order": 3, "active": true, "api_url": null, @@ -145,30 +145,30 @@ "model": "core.eligibilityverifier", "pk": 3, "fields": { - "name": "(MST) eligibility server verifier", + "name": "(CST) eligibility server verifier", "display_order": 4, "active": true, "api_url": "http://server:8000/verify", "api_auth_header": "X-Server-API-Key", - "api_auth_key_secret_name": "courtesy-card-verifier-api-auth-key", + "api_auth_key_secret_name": "agency-card-verifier-api-auth-key", "eligibility_type": 3, "public_key": 1, "jwe_cek_enc": "A256CBC-HS512", "jwe_encryption_alg": "RSA-OAEP", "jws_signing_alg": "RS256", "auth_provider": null, - "selection_label_template": "eligibility/includes/selection-label--mst-courtesy-card.html", - "start_template": "eligibility/start--mst-courtesy-card.html", - "form_class": "benefits.eligibility.forms.MSTCourtesyCard", - "unverified_template": "eligibility/unverified--mst-courtesy-card.html", - "help_template": "core/includes/help--mst-courtesy-card.html" + "selection_label_template": "eligibility/includes/selection-label--cst-agency-card.html", + "start_template": "eligibility/start--cst-agency-card.html", + "form_class": "benefits.eligibility.forms.CSTAgencyCard", + "unverified_template": "eligibility/unverified--cst-agency-card.html", + "help_template": "core/includes/help--cst-agency-card.html" } }, { "model": "core.eligibilityverifier", "pk": 7, "fields": { - "name": "(MST) CalFresh oauth claims via Login.gov", + "name": "(CST) CalFresh oauth claims via Login.gov", "display_order": 2, "active": true, "api_url": null, @@ -190,10 +190,10 @@ "model": "core.paymentprocessor", "pk": 1, "fields": { - "name": "(MST) test payment processor", + "name": "(CST) test payment processor", "api_base_url": "http://server:8000", "client_id": "", - "client_secret_name": "mst-payment-processor-client-secret", + "client_secret_name": "cst-payment-processor-client-secret", "audience": "", "card_tokenize_url": "http://server:8000/static/tokenize.js", "card_tokenize_func": "tokenize", @@ -204,19 +204,19 @@ "model": "core.transitagency", "pk": 1, "fields": { - "slug": "mst", - "short_name": "MST (local)", - "long_name": "Monterey-Salinas Transit (local)", - "agency_id": "mst", - "info_url": "https://mst.org/benefits", - "phone": "888-678-2871", + "slug": "cst", + "short_name": "CST (local)", + "long_name": "California State Transit (local)", + "agency_id": "cst", + "info_url": "https://www.agency-website.com", + "phone": "1-800-555-5555", "active": true, "payment_processor": 1, "private_key": 3, "public_key": 4, "jws_signing_alg": "RS256", - "index_template": "core/index--mst.html", - "eligibility_index_template": "eligibility/index--mst.html", + "index_template": "core/index--cst.html", + "eligibility_index_template": "eligibility/index--cst.html", "eligibility_types": [1, 7, 2, 3], "eligibility_verifiers": [1, 7, 2, 3] } From 98535134a14ee4cd6dcd4f7fb035dda0ec99b470 Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Thu, 11 Jul 2024 04:33:46 +0000 Subject: [PATCH 4/8] fix(fixtures): clean up IDs --- benefits/core/migrations/local_fixtures.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/benefits/core/migrations/local_fixtures.json b/benefits/core/migrations/local_fixtures.json index be917a8c2..942ad116f 100644 --- a/benefits/core/migrations/local_fixtures.json +++ b/benefits/core/migrations/local_fixtures.json @@ -10,7 +10,7 @@ }, { "model": "core.pemdata", - "pk": 3, + "pk": 2, "fields": { "label": "Benefits client private key", "text_secret_name": "client-private-key", @@ -19,7 +19,7 @@ }, { "model": "core.pemdata", - "pk": 4, + "pk": 3, "fields": { "label": "Benefits client public key", "text_secret_name": "client-public-key", @@ -87,7 +87,7 @@ }, { "model": "core.eligibilitytype", - "pk": 7, + "pk": 4, "fields": { "name": "calfresh", "label": "CalFresh", @@ -166,7 +166,7 @@ }, { "model": "core.eligibilityverifier", - "pk": 7, + "pk": 4, "fields": { "name": "(CST) CalFresh oauth claims via Login.gov", "display_order": 2, @@ -174,7 +174,7 @@ "api_url": null, "api_auth_header": null, "api_auth_key_secret_name": null, - "eligibility_type": 7, + "eligibility_type": 4, "public_key": null, "jwe_cek_enc": null, "jwe_encryption_alg": null, @@ -212,13 +212,13 @@ "phone": "1-800-555-5555", "active": true, "payment_processor": 1, - "private_key": 3, - "public_key": 4, + "private_key": 2, + "public_key": 3, "jws_signing_alg": "RS256", "index_template": "core/index--cst.html", "eligibility_index_template": "eligibility/index--cst.html", - "eligibility_types": [1, 7, 2, 3], - "eligibility_verifiers": [1, 7, 2, 3] + "eligibility_types": [1, 2, 3, 4], + "eligibility_verifiers": [1, 2, 3, 4] } } ] From a80e861b075b21885d377d4dfe08918e22dbadc7 Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Thu, 11 Jul 2024 22:26:03 +0000 Subject: [PATCH 5/8] chore(env): remove mst/sbmtd/sacrt from sample, use cst --- .env.sample | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.env.sample b/.env.sample index 4ea4af189..807966ef6 100644 --- a/.env.sample +++ b/.env.sample @@ -8,12 +8,9 @@ DJANGO_DB_FILE=django.db DJANGO_DB_FIXTURES="benefits/core/migrations/local_fixtures.json" auth_provider_client_id=benefits-oauth-client-id -courtesy_card_verifier_api_auth_key=server-auth-token -mobility_pass_verifier_api_auth_key=server-auth-token +agency_card_verifier_api_auth_key=server-auth-token client_private_key='-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEA1pt0ZoOuPEVPJJS+5r884zcjZLkZZ2GcPwr79XOLDbOi46on\nCa79kjRnhS0VUK96SwUPS0z9J5mDA5LSNL2RoxFb5QGaevnJY828NupzTNdUd0sY\nJK3kRjKUggHWuB55hwJcH/Dx7I3DNH4NL68UAlK+VjwJkfYPrhq/bl5z8ZiurvBa\n5C1mDxhFpcTZlCfxQoas7D1d+uPACF6mEMbQNd3RaIaSREO50NvNywXIIt/OmCiR\nqI7JtOcn4eyh1I4j9WtlbMhRJLfwPMAgY5epTsWcURmhVofF2wVoFbib3JGCfA7t\nz/gmP5YoEKnf/cumKmF3e9LrZb8zwm7bTHUViwIDAQABAoIBAQCIv0XMjNvZS9DC\nXoXGQtVpcxj6dXfaiDgnc7hZDubsNCr3JtT5NqgdIYdVNQUABNDIPNEiCkzFjuwM\nuuF2+dRzM/x6UCs/cSsCjXYBCCOwMwV/fjpEJQnwMQqwTLulVsXZYYeSUtXVBf/8\n0tVULRty34apLFhsyX30UtboXQdESfpmm5ZsqsZJlYljw+M7JxRMneQclI19y/ya\nhPWlfhLB9OffVEJXGaWx1NSYnKoCMKqE/+4krROr6V62xXaNyX6WtU6XiT7C6R5A\nPBxfhmoeFdVCF6a+Qq0v2fKThYoZnV4sn2q2An9YPfynFYnlgzdfnAFSejsqxQd0\nfxYLOtMBAoGBAP1jxjHDJngZ1N+ymw9MIpRgr3HeuMP5phiSTbY2tu9lPzQd+TMX\nfhr1bQh2Fd/vU0u7X0yPnTWtUrLlCdGnWPpXivx95GNGgUUIk2HStFdrRx+f2Qvk\nG8vtLgmSbjQ26UiHzxi9Wa0a41PWIA3TixkcFrS2X29Qc4yd6pVHmicfAoGBANjR\nZ8aaDkSKLkq5Nk1T7I0E1+mtPoH1tPV/FJClXjJrvfDuYHBeOyUpipZddnZuPGWA\nIW2tFIsMgJQtgpvgs52NFI7pQGJRUPK/fTG+Ycocxo78TkLr/RIj8Kj5brXsbZ9P\n3/WBX5GAISTSp1ab8xVgK/Tm07hGupKVqnY2lCAVAoGAIql0YjhE2ecGtLcU+Qm8\nLTnwpg4GjmBnNTNGSCfB7IuYEsQK489R49Qw3xhwM5rkdRajmbCHm+Eiz+/+4NwY\nkt5I1/NMu7vYUR40MwyEuPSm3Q+bvEGu/71pL8wFIUVlshNJ5CN60fA8qqo+5kVK\n4Ntzy7Kq6WpC9Dhh75vE3ZcCgYEAty99uXtxsJD6+aEwcvcENkUwUztPQ6ggAwci\nje9Z/cmwCj6s9mN3HzfQ4qgGrZsHpk4ycCK655xhilBFOIQJ3YRUKUaDYk4H0YDe\nOsf6gTP8wtQDH2GZSNlavLk5w7UFDYQD2b47y4fw+NaOEYvjPl0p5lmb6ebAPZb8\nFbKZRd0CgYBC1HTbA+zMEqDdY4MWJJLC6jZsjdxOGhzjrCtWcIWEGMDF7oDDEoix\nW3j2hwm4C6vaNkH9XX1dr5+q6gq8vJQdbYoExl22BGMiNbfI3+sLRk0zBYL//W6c\ntSREgR4EjosqQfbkceLJ2JT1wuNjInI0eR9H3cRugvlDTeWtbdJ5qA==\n-----END RSA PRIVATE KEY-----' client_public_key='-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1pt0ZoOuPEVPJJS+5r88\n4zcjZLkZZ2GcPwr79XOLDbOi46onCa79kjRnhS0VUK96SwUPS0z9J5mDA5LSNL2R\noxFb5QGaevnJY828NupzTNdUd0sYJK3kRjKUggHWuB55hwJcH/Dx7I3DNH4NL68U\nAlK+VjwJkfYPrhq/bl5z8ZiurvBa5C1mDxhFpcTZlCfxQoas7D1d+uPACF6mEMbQ\nNd3RaIaSREO50NvNywXIIt/OmCiRqI7JtOcn4eyh1I4j9WtlbMhRJLfwPMAgY5ep\nTsWcURmhVofF2wVoFbib3JGCfA7tz/gmP5YoEKnf/cumKmF3e9LrZb8zwm7bTHUV\niwIDAQAB\n-----END PUBLIC KEY-----' -mst_payment_processor_client_secret=secret -sacrt_payment_processor_client_secret=secret -sbmtd_payment_processor_client_secret=secret +cst_payment_processor_client_secret=secret testsecret="Hello from the local environment!" From 1d6560ba4be38f7b81445c5bb9faf408033b22d4 Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Thu, 11 Jul 2024 04:46:12 +0000 Subject: [PATCH 6/8] test(cypress): update cypress with cst flows --- tests/cypress/plugins/helpers.js | 4 ++-- .../specs/{courtesy-cards.cy.js => agency-cards.cy.js} | 4 ++-- tests/cypress/specs/benefit-select.cy.js | 2 +- tests/cypress/specs/rate-limit.cy.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) rename tests/cypress/specs/{courtesy-cards.cy.js => agency-cards.cy.js} (93%) diff --git a/tests/cypress/plugins/helpers.js b/tests/cypress/plugins/helpers.js index a5ac68c21..db5f80496 100644 --- a/tests/cypress/plugins/helpers.js +++ b/tests/cypress/plugins/helpers.js @@ -22,10 +22,10 @@ export const selectAgency = () => { return agency; }; -export const selectCourtesyCard = () => { +export const selectAgencyCard = () => { cy.location("pathname").should("eq", `/eligibility/${agency.slug}`); - cy.contains("MST Courtesy Card").click(); + cy.contains("CST Agency Card").click(); cy.contains("Choose this benefit").click(); cy.contains("Continue").click(); }; diff --git a/tests/cypress/specs/courtesy-cards.cy.js b/tests/cypress/specs/agency-cards.cy.js similarity index 93% rename from tests/cypress/specs/courtesy-cards.cy.js rename to tests/cypress/specs/agency-cards.cy.js index 823f1db60..125e1d5e1 100644 --- a/tests/cypress/specs/courtesy-cards.cy.js +++ b/tests/cypress/specs/agency-cards.cy.js @@ -1,12 +1,12 @@ const helpers = require("../plugins/helpers"); const users = require("../fixtures/users.json"); -describe("Courtesy Cards", () => { +describe("Agency Cards", () => { beforeEach(() => { cy.visit("/"); helpers.selectAgency(); - helpers.selectCourtesyCard(); + helpers.selectAgencyCard(); }); it("Confirms an eligible user", () => { diff --git a/tests/cypress/specs/benefit-select.cy.js b/tests/cypress/specs/benefit-select.cy.js index 9ee369c5a..75101d78a 100644 --- a/tests/cypress/specs/benefit-select.cy.js +++ b/tests/cypress/specs/benefit-select.cy.js @@ -10,7 +10,7 @@ describe("Benefit selection", () => { it("User sees 4 radio buttons", () => { cy.get("input:radio").should("have.length", 4); - cy.contains("Courtesy Card"); + cy.contains("Agency Card"); cy.contains("65 years"); }); diff --git a/tests/cypress/specs/rate-limit.cy.js b/tests/cypress/specs/rate-limit.cy.js index bfc534de6..ebb245ea1 100644 --- a/tests/cypress/specs/rate-limit.cy.js +++ b/tests/cypress/specs/rate-limit.cy.js @@ -10,7 +10,7 @@ describe("Rate limiting feature spec", () => { cy.visit("/"); helpers.selectAgency(); - helpers.selectCourtesyCard(); + helpers.selectAgencyCard(); }); it("Limits excess requests", () => { From 3683cbbae1dafcfb894dd1cf04f4523c7d2f2e9b Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Thu, 11 Jul 2024 22:50:22 +0000 Subject: [PATCH 7/8] test(cypress): delete mst, sbmtd test --- tests/pytest/eligibility/test_forms.py | 38 +------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/tests/pytest/eligibility/test_forms.py b/tests/pytest/eligibility/test_forms.py index 1460bc9e9..1707130e4 100644 --- a/tests/pytest/eligibility/test_forms.py +++ b/tests/pytest/eligibility/test_forms.py @@ -1,4 +1,4 @@ -from benefits.eligibility.forms import CSTAgencyCard, MSTCourtesyCard, SBMTDMobilityPass +from benefits.eligibility.forms import CSTAgencyCard def test_CSTAgencyCard(): @@ -17,39 +17,3 @@ def test_CSTAgencyCard(): assert name_attrs["data-custom-validity"] == "Please enter your last name." assert form.use_custom_validity - - -def test_MSTCourtesyCard(): - form = MSTCourtesyCard(data={"sub": "12345", "name": "Gonzalez"}) - - assert form.is_valid() - - sub_attrs = form.fields["sub"].widget.attrs - assert sub_attrs["pattern"] == r"\d{5}" - assert sub_attrs["inputmode"] == "numeric" - assert sub_attrs["maxlength"] == 5 - assert sub_attrs["data-custom-validity"] == "Please enter a 5-digit number." - - name_attrs = form.fields["name"].widget.attrs - assert name_attrs["maxlength"] == 255 - assert name_attrs["data-custom-validity"] == "Please enter your last name." - - assert form.use_custom_validity - - -def test_SBMTDMobilityPass(): - form = SBMTDMobilityPass(data={"sub": "1234", "name": "Barbara"}) - - assert form.is_valid() - - sub_attrs = form.fields["sub"].widget.attrs - assert sub_attrs["pattern"] == r"\d{4}" - assert sub_attrs["maxlength"] == 4 - assert sub_attrs["inputmode"] == "numeric" - assert sub_attrs["data-custom-validity"] == "Please enter a 4-digit number." - - name_attrs = form.fields["name"].widget.attrs - assert name_attrs["maxlength"] == 255 - assert name_attrs["data-custom-validity"] == "Please enter your last name." - - assert form.use_custom_validity From 3a86db1e9be8df1cbf1ce7ca79d69928eadbbc13 Mon Sep 17 00:00:00 2001 From: Machiko Yasuda Date: Mon, 15 Jul 2024 16:33:19 +0000 Subject: [PATCH 8/8] fix(tests): keep form tests --- tests/pytest/eligibility/test_forms.py | 38 +++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/tests/pytest/eligibility/test_forms.py b/tests/pytest/eligibility/test_forms.py index 1707130e4..1460bc9e9 100644 --- a/tests/pytest/eligibility/test_forms.py +++ b/tests/pytest/eligibility/test_forms.py @@ -1,4 +1,4 @@ -from benefits.eligibility.forms import CSTAgencyCard +from benefits.eligibility.forms import CSTAgencyCard, MSTCourtesyCard, SBMTDMobilityPass def test_CSTAgencyCard(): @@ -17,3 +17,39 @@ def test_CSTAgencyCard(): assert name_attrs["data-custom-validity"] == "Please enter your last name." assert form.use_custom_validity + + +def test_MSTCourtesyCard(): + form = MSTCourtesyCard(data={"sub": "12345", "name": "Gonzalez"}) + + assert form.is_valid() + + sub_attrs = form.fields["sub"].widget.attrs + assert sub_attrs["pattern"] == r"\d{5}" + assert sub_attrs["inputmode"] == "numeric" + assert sub_attrs["maxlength"] == 5 + assert sub_attrs["data-custom-validity"] == "Please enter a 5-digit number." + + name_attrs = form.fields["name"].widget.attrs + assert name_attrs["maxlength"] == 255 + assert name_attrs["data-custom-validity"] == "Please enter your last name." + + assert form.use_custom_validity + + +def test_SBMTDMobilityPass(): + form = SBMTDMobilityPass(data={"sub": "1234", "name": "Barbara"}) + + assert form.is_valid() + + sub_attrs = form.fields["sub"].widget.attrs + assert sub_attrs["pattern"] == r"\d{4}" + assert sub_attrs["maxlength"] == 4 + assert sub_attrs["inputmode"] == "numeric" + assert sub_attrs["data-custom-validity"] == "Please enter a 4-digit number." + + name_attrs = form.fields["name"].widget.attrs + assert name_attrs["maxlength"] == 255 + assert name_attrs["data-custom-validity"] == "Please enter your last name." + + assert form.use_custom_validity