Skip to content

[in progress] scriptlets as an npm module #1757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

dharb
Copy link
Contributor

@dharb dharb commented Jun 18, 2025

Asana Task/Github Issue:

Description

Testing Steps

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

@dharb dharb requested a review from a team as a code owner June 18, 2025 19:19
Copy link

netlify bot commented Jun 18, 2025

Deploy Preview for content-scope-scripts failed.

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/projects/content-scope-scripts/deploys/68542f2a9e5549da706d39dc

Copy link

github-actions bot commented Jun 18, 2025

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

github-actions bot commented Jun 18, 2025

[Beta] Generated file diff

Time updated: Thu, 19 Jun 2025 15:23:39 GMT

Integration
    - integration/contentScope.js

File has changed

Apple
    - dist/contentScope.js

File has changed


const test = testContextForExtension(base);

test.describe('Scriptlets Integration Tests', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is all this a dupe of the test-pages stuff? I see a lot of waitForTimeout too which is pretty flakey.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see it's supposed to be testing them. it seems a lot more involved than the intent here. Can you ask it to make this file more like injected/integration-test/pages.spec.js where there's no state where possible this will make most of them work in privacy-test-pages.site without having special setup code?

I also don't see it using the config in automation? Perhaps I've misread?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -13,13 +13,13 @@
<p>This page verifies that the remove-node-text scriptlet works properly given the <a href="../config/remove-node-text.json">config</a>.</p>

<!-- This script should have its content removed because it contains "badScriptContent" -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this test just be checking for regular div text change removal? Given the abort inline script it seems a little misleading as a test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants