From f828108161404bb8a441266a34ce5a141905fa7a Mon Sep 17 00:00:00 2001 From: David Schultz Date: Tue, 24 Oct 2023 11:57:45 -0400 Subject: [PATCH] new test cases that should be valid --- cypress/integration/home.spec.js | 4 ++-- tests/test_api_users.py | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cypress/integration/home.spec.js b/cypress/integration/home.spec.js index 010c1e9..d7b17ca 100644 --- a/cypress/integration/home.spec.js +++ b/cypress/integration/home.spec.js @@ -66,7 +66,7 @@ context('Home Page', () => { cy.get('.profile [name="loginShell"]').should('exist').should('not.have.attr', 'disabled') - cy.get('.profile [name="orcid"]').should('exist').type('1234-1234-1234-1234') + cy.get('.profile [name="orcid"]').should('exist').type('1234-1234-1234-123X') cy.get('.profile button').click() cy.wait('@api-user-profile-put').should(({ request, response }) => { @@ -80,7 +80,7 @@ context('Home Page', () => { 'author_firstName': '', 'author_lastName': '', 'author_email': '', - 'orcid': '1234-1234-1234-1234', + 'orcid': '1234-1234-1234-123X', 'phd_year': '', 'github': '', 'slack': '', diff --git a/tests/test_api_users.py b/tests/test_api_users.py index 17aa443..3d4f008 100644 --- a/tests/test_api_users.py +++ b/tests/test_api_users.py @@ -59,7 +59,11 @@ async def test_user_put(server): await client.request('PUT', '/api/users/test', {'orcid': '0000-0001-8945-6722'}) ret = await krs.users.user_info('test', rest_client=krs_client) - assert ret['attributes']['orcid'] == '0000-0001-8945-6722' + assert ret['attributes']['orcid'] == '0000-0001-8945-6722' + + await client.request('PUT', '/api/users/test', {'orcid': '0001-0002-0003-000X'}) + ret = await krs.users.user_info('test', rest_client=krs_client) + assert ret['attributes']['orcid'] == '0001-0002-0003-000X' with pytest.raises(Exception): await client.request('PUT', '/api/users/test', {'orcid': '1-2-3-4'})