Skip to content

Adding test for setting video field#2888

Closed
gurtejrehal wants to merge 16 commits intofacebook:mainfrom
gurtejrehal:test_for_video_field
Closed

Adding test for setting video field#2888
gurtejrehal wants to merge 16 commits intofacebook:mainfrom
gurtejrehal:test_for_video_field

Conversation

@gurtejrehal
Copy link
Copy Markdown
Contributor

@gurtejrehal gurtejrehal commented Feb 18, 2025

Changes proposed in this Pull Request:

This test is related to #2874 to verify the functionality of the video_field setting.
In other words, this test ensures that setting a video_field to an empty value is equivalent to not setting it at all, and that no additional steps are needed to reset or clear the field.

  • Do the changed files pass phpcs checks? Please remove phpcs:ignore comments in changed files and fix any issues, or delete if not practical.

Flow

When setting a video field, the following steps are performed:

  • Convert Attachment IDs to Video URLs: The provided attachment_ids are converted into corresponding video_urls.
  • Create a Video Array: The converted video_urls are then stored in an array.
  • Save the Video Array: The resulting video array is saved as the new value for the video_field.

Detailed test instructions:

  1. ./vendor/bin/phpunit --filter test_set_product_video_urls
image
  1. npm run test:php

gurtejrehal and others added 16 commits February 18, 2025 12:24
Summary:

This PR introduces a new feature to the Facebook WooCommerce Plugin, allowing users to add rich text descriptions to their products. With this update, we can seamlessly synchronize the rich text description field with the Facebook Commerce Manager platform.

It also adds functionality for a WYSIWYG input box for the Facebook Description field in the plugin

- Updated the product sync logic to handle rich text formatting.
- Modified the API payload to include the rich text description field.
- Tested for compatibility with common formatting options (bold, italic, lists, links, etc.).

- Improves the visual appeal of product descriptions on Meta.
- Ensures consistent branding and formatting across platforms.
- Enhances user engagement by presenting more structured and detailed product information.

1. Enable the WooCommerce to Meta product sync.
2. Create or edit a product in WooCommerce with a rich text description (e.g., headings, bold, italic, lists).
3. Sync the product and verify that the description appears correctly formatted on Meta.

<img width="1244" alt="Screenshot 2024-11-04 at 11 21 23" src="https://github.com/user-attachments/assets/eb1c1fbb-5734-4c27-b710-1e031f1a58e6">
<img width="601" alt="Screenshot 2024-11-04 at 11 22 26" src="https://github.com/user-attachments/assets/a40f84e8-3127-4b62-a87d-c172ab257a98">
<img width="753" alt="Screenshot 2024-11-04 at 11 22 41" src="https://github.com/user-attachments/assets/75063389-5a78-4ae2-a73f-c2a392427472">
<img width="740" alt="Screenshot 2024-12-24 at 18 24 52" src="https://github.com/user-attachments/assets/e011e53e-9892-4e06-ace1-bfd7e22dab22" />

 ---

Please let me know if there are any edge cases or scenarios that should be tested further.

Pull Request resolved: facebook#2843

Reviewed By: vinkmeta

Differential Revision: D69199179

Pulled By: devbodaghe

fbshipit-source-id: 8d620efa52fe16c9c936dc8ad4136689d273dc8c
Summary:

This PR introduces a new feature to the Facebook WooCommerce Plugin, allowing users to add rich text descriptions to their products. With this update, we can seamlessly synchronize the rich text description field with the Facebook Commerce Manager platform.

It also adds functionality for a WYSIWYG input box for the Facebook Description field in the plugin

- Updated the product sync logic to handle rich text formatting.
- Modified the API payload to include the rich text description field.
- Tested for compatibility with common formatting options (bold, italic, lists, links, etc.).

- Improves the visual appeal of product descriptions on Meta.
- Ensures consistent branding and formatting across platforms.
- Enhances user engagement by presenting more structured and detailed product information.

1. Enable the WooCommerce to Meta product sync.
2. Create or edit a product in WooCommerce with a rich text description (e.g., headings, bold, italic, lists).
3. Sync the product and verify that the description appears correctly formatted on Meta.

<img width="1244" alt="Screenshot 2024-11-04 at 11 21 23" src="https://github.com/user-attachments/assets/eb1c1fbb-5734-4c27-b710-1e031f1a58e6">
<img width="601" alt="Screenshot 2024-11-04 at 11 22 26" src="https://github.com/user-attachments/assets/a40f84e8-3127-4b62-a87d-c172ab257a98">
<img width="753" alt="Screenshot 2024-11-04 at 11 22 41" src="https://github.com/user-attachments/assets/75063389-5a78-4ae2-a73f-c2a392427472">
<img width="740" alt="Screenshot 2024-12-24 at 18 24 52" src="https://github.com/user-attachments/assets/e011e53e-9892-4e06-ace1-bfd7e22dab22" />

 ---

Please let me know if there are any edge cases or scenarios that should be tested further.

Pull Request resolved: facebook#2843

Reviewed By: vinkmeta

Differential Revision: D69199179

Pulled By: devbodaghe

fbshipit-source-id: 8d620efa52fe16c9c936dc8ad4136689d273dc8c
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. (Because this pull request was imported automatically, there will not be any future comments.)

@gurtejrehal gurtejrehal changed the title Test for video field Adding test for setting video field Feb 18, 2025
@facebook-github-bot
Copy link
Copy Markdown
Contributor

This pull request has been merged in 988e961.

@gurtejrehal gurtejrehal deleted the test_for_video_field branch February 18, 2025 16:44
facebook-github-bot pushed a commit that referenced this pull request Feb 25, 2025
Summary:
## Changelog:

* Add - FB product video field to add videos. Also added products sync to support the video field with Batch API by gurtejrehal in #2874
* Tweak - tests for #2874 by gurtejrehal in #2888
* Tweak - tests for Product Update action as ramp up task by nealweiMeta in #2883
* Fix - translations loading before the init hook by iodic in #2866
* Fix - Fixed feeds by requesting a feed file upload session after feed file is generated and added missing new fields to the feed file by mshymon in #2841

Pull Request resolved: #2891

Reviewed By: akpurifb

Differential Revision: D69836863

Pulled By: vahidkay-meta

fbshipit-source-id: 32408ab4b42f60f921bd599ed982933017185b5e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants