jsdecena / laracom

Laravel FREE E-Commerce Software
https://jsdecena.github.io/laracom
1.91k stars 861 forks source link

#Fix Cover image is not displayed on the top page #293

Closed ysknsid25 closed 1 year ago

ysknsid25 commented 1 year ago

Occurring event

Register a Cover image in the admin panel.

image

Check on the top page

image

Cover image is not displayed.

Direct cause

The path of the Cover image on the top page is not correct.

Wrong(before fix)

image

Correct(before fix)

Temporary rewrite of path from "validation" showed up correctly

image

Root cause

Not using function transformProduct of trait ProductTransformable.

For example, the Cover image on the admin page is displayed correctly because using function transformProduct.

image

Corrective actions

Set the products acquired in HomeController to the correct paths by using the function transformProduct of therait ProductTransformable, and set them to the variables cat1 and cat2.

This caused the image to appear correctly on the Top page.

image

jsdecena commented 1 year ago

this is good @ysknsid25 but the test is failing

ysknsid25 commented 1 year ago

this is good @ysknsid25 but the test is failing

Our sincere apologies. We will contact you after rechecking.

ysknsid25 commented 1 year ago

@jsdecena

image

Sorry, it is succeeding locally but failing on Github Actions. I will look into it some more.

ysknsid25 commented 1 year ago

@jsdecena

The cause of test code failure is the presence of apostrophes in the generated test data.

The location where the GithubAcions error occurs is different each time.

1. Tests\Feature\Admin\Brands\BrandFeatureTest::it_can_list_all_the_brands

image

2.Tests\Feature\Admin\Courier\CourierFeatureTest::it_can_list_all_couriers

image

Both test cases verify the same process.

That is the process of whether the value of the name column of the registered data is displayed on the screen.

However, in both error patterns, the apostrophe is displayed as ' due to the HTML encoding process.

In conclusion, we believe that these test codes are inappropriate because the test codes may throw errors if the generated test data happen to contain apostrophes.

We will make additional modifications to the test codes that correct this condition.

jsdecena commented 1 year ago

I see what you mean, all good! I will fix it up later myself. :)

ysknsid25 commented 1 year ago

@jsdecena

Thanks for fixing the test code! We will look at how it was modified at a later date.