Skip to content

Commit

Permalink
Minor spec for behaviour update
Browse files Browse the repository at this point in the history
  • Loading branch information
Locrian24 committed Feb 6, 2024
1 parent f9b7d49 commit b3ee8bb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/widgets/EmbedWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default class EmbedWidget extends Widget {
if (this._shouldFireLoadEvent()) {
this._loadEvent(_sqh);
_log("loaded");
} else {
} else if (frameDoc) {
this._attachLoadEventListener(frameDoc, _sqh);
}
});
Expand Down
12 changes: 12 additions & 0 deletions test/specs/InstantAccessRendering.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ Feature: Instant Access Widget rendering
When the widget is loaded by squatchJs
Then there will be no Load Analytics API event

@minutia
Scenario: A Load Analytics API event is fired by an Instant Access widget once a user has been registered within the widget
Given a widget is rendered with the code
"""
squatch.widget(initObj)
"""
And there is no user object or jwt in the initObj
When the widget is loaded by squatchJs
Then an event listener is attached to the widget iframe's document body
When a "sq:user-registration" event is fired from the widget
Then a Load Analytics API event is fired

@landmine
Scenario: Rendering a Verified Access widget with `squatch.widget` causes component errors
Given a widget is rendered with the code
Expand Down

0 comments on commit b3ee8bb

Please sign in to comment.