Skip to content

VaAlert event va-component-did-load does not have a test and implementation is not explained in Storybook #3866

Open
@pmclaren19

Description

@pmclaren19

Bug Report

While attempting to use the event va-component-did-load found that it didnt appear to be working, also found while looking at the code that there were no tests around the event.

What happened

The event va-component-did-load on vaAlert appear to not properly work and there are no tests or an explanation of how to implement it in Storybook.

What I expected to happen

The event va-component-did-load on vaAlert should emit and it is not.
Also there are no tests or an example of how to use it in code.

Reproducing

In code added this

    <VaAlert
      close-btn-aria-label="Close notification"
      className="claims-alert"
      closeable={closeable}
      onCloseEvent={onClose}
      status={type}
      visible
      onVaComponentDidLoad={() => {
        console.log('Component Loaded');
      }}
    >
      <h2 slot="headline">{title}</h2>
      <p className="vads-u-margin-y--0">{body}</p>
    </VaAlert>

and it did not work. After messing around with the event name I tried this an it appears to work but it is not intuitive.

    <VaAlert
      close-btn-aria-label="Close notification"
      className="claims-alert"
      closeable={closeable}
      onCloseEvent={onClose}
      status={type}
      visible
      onVa-component-did-load={() => {
        console.log('Component Loaded');
      }}
    >
      <h2 slot="headline">{title}</h2>
      <p className="vads-u-margin-y--0">{body}</p>
    </VaAlert>

Urgency

How urgent is this request? Please select the appropriate option below and/or provide details

  • This bug is blocking work currently in progress
  • This bug is affecting work currently in progress but we have a workaround
  • This bug is blocking work planned within the next few sprints
  • This bug is not blocking any work
  • Other

Details

We would like the ability to use onVaComponentDidLoad instead of using onVa-component-did-load. We would also like there to be tests around this event and for storybook to better explain how implementation works for this event as it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions