freeCodeCamp / publish

> Content backend platform for /news
https://publish.freecodecamp.org
BSD 3-Clause "New" or "Revised" License
10 stars 9 forks source link

fix: feature image type and feature image saving #377

Closed Sembauke closed 8 months ago

Sembauke commented 10 months ago

Seems like the import script from Ghost does not need to be updated as adding the Single Media type through an API call is the same as one with a type of Multi Media. Meaning, the single media type is able to be send in an array as well.

closes #370 closes #372

Sembauke commented 10 months ago

@Nirajn2311, as you wrote the script. Can you confirm what I posted in the OP?

Sembauke commented 10 months ago

It seems like it is possible to choose files with playwright.

https://playwright.dev/docs/api/class-filechooser

sidemt commented 10 months ago

It seems like it is possible to choose files with playwright.

Cool! In that case, what I would do is to add a image file in e2e/helpers directory or somewhere, and use it in the tests. (I have done similar thing in a different test framework, but not sure if it works with playwright)

I also confirmed that our migration script works even with this change in Strapi app. Looks like Strapi is smart enough to handle the relation notation with or without []. Referred to: https://docs.strapi.io/dev-docs/api/rest/relations

sidemt commented 8 months ago

I'm going to merge this PR for now. Let me know or open another PR if you find any problems with the tests I added. Thanks!