Skip to content

Commit

Permalink
fix: update LWC tests
Browse files Browse the repository at this point in the history
  • Loading branch information
muenzpraeger committed Oct 28, 2024
1 parent 218d63f commit c1c910c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('c-experience-schedule', () => {
const labelEls = cardEls[0].querySelectorAll(
'.slds-form-element div.slds-form-element__control'
);
const statusEl = labelEls[labelEls.length - 1];
const statusEl = labelEls[labelEls.length - 2];
expect(statusEl.textContent).toBe(`${mockSessions[0].Status__c}`);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ describe('c-generate-social-media-posts', () => {
expect(textAreaEls.length).toBe(3);
});

it('renders the error panel when the Apex method returns an error', async () => {
it('renders the "Try Again!" button when the Apex method returns an error', async () => {
// Assign mock value for rejected Apex promise
generateSocialMediaPosts.mockRejectedValue(MOCK_APEX_ERROR);

Expand All @@ -75,9 +75,9 @@ describe('c-generate-social-media-posts', () => {
// Wait for any asynchronous DOM updates
await flushPromises();

// Check for error panel
const errorPanelEl = element.shadowRoot.querySelector('c-error-panel');
expect(errorPanelEl).not.toBeNull();
const buttonTryAgainEl =
element.shadowRoot.querySelector('lightning-button');
expect(buttonTryAgainEl.label).toEqual('Try again!');
});

it('is accessible', async () => {
Expand Down

0 comments on commit c1c910c

Please sign in to comment.