IntersectMBO / govtool

🔩 GovTool and utilities monorepo.
https://preview.gov.tools
Apache License 2.0
10 stars 7 forks source link

[BUG] Remaining Missing Test IDs on PDF #1568

Closed kneerose closed 4 weeks ago

kneerose commented 1 month ago

Context & versions

Missing test IDs

  1. Proposal Card
    • Governance action type -> data-testid=governance-action-type
    • Proposed on date -> data-testid = proposed-date
    • It will be better to change the proposal card testId like proposal-${governanceActionType}-card as the previous test ID conflict with filtering

Screenshot from 2024-07-12 13-10-12

  1. Proposal Details
    • Governance action type-content -> data-testid=governance-action-type-content
    • Title content -> data-testid= title-content
    • Abstract Content -> data-testid=abstract-content
    • Motivation Content -> data-testid=motivation-content
    • Rationale Content -> data-testid=rationale-content
    • Link text content -> data-testid=link-${index}-text-content

image

image

image

Screenshot from 2024-07-12 15-41-04

kneerose commented 1 month ago

Hello @teske00, I have noticed that the test IDs for filters have different naming conventions. For example, "Info" and "Treasury" start with a capital letter, whereas "submitted for vote" and "active proposal" starts with a lowercase letter. Please standardize the naming conventions of the test IDs for all filters.

image Screenshot from 2024-07-22 13-46-41

kneerose commented 1 month ago

@teske00, furthermore, the status should be inside the proposal card. I cannot test which status belongs to which proposal card.

image

image"

teske00 commented 1 month ago

@kneerose The component is structured like this, the only thing we can do now so as not to break the entire logic is to set the name of the status in the data-testId of the status, for example 'data-testid': proposal-${proposal?.id}-{status_name }-status. Also, for the proposal card, in addition to proposal-{status_name}-card, add proposalid in the name, so that it becomes proposal{proposal_id}-{status_name}-card. In this way, it is possible to connect which status belongs to which card. Is it ok to do it like this?

kneerose commented 1 month ago

@teske00, I don't think this approach is ideal. We are retrieving a list of proposal locators proposal-${govactionType}-card and checking the status inside each proposal card. If the component is structured this way, could you change the data-test-id of the proposal card to be the parent element of the status and the current <div> tag which is using the data-test-id of the card. ie. proposal-${govactionType}-card. If it is possible.

teske00 commented 1 month ago

@kneerose As far as I understand you, you mean to put the card and status in a div to which we will add the test id "proposal-${govactionType}-card", and remove it from the current div (card). And what do you think if we change the testId for draft cards to follow that structure, and not to be draft-${proposal?.id}-card, how is it now?

teske00 commented 1 month ago

@kneerose And is it perhaps necessary to add the proposal id to the testID in addition to the name of the status?

teske00 commented 1 month ago

@kneerose Is this the desired structure, the card component with test id wraps the card content and status. I didn't change the other testIDs, I just moved the current testIDs that were in the wrapper components. Is this enough?

image

kneerose commented 1 month ago

@teske00, yes this is the desired structure

teske00 commented 1 month ago

@kneerose The old testId names can remain as they are now, we just need to do this?

kneerose commented 1 month ago

@teske00 yes, only thing you have to do is change the position of the card test ID.

kneerose commented 4 weeks ago

@teske00 I''ve located the missing test IDs mentioned above. The test IDs are now available in the test environment.

This issue can be closed now. CC: @bosko-m

bosko-m commented 4 weeks ago

Closing as per the comment above.