Skip to content
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

Improve the CBT_Theme_Fonts class tests #711

Open
matiasbenedetto opened this issue Aug 29, 2024 · 0 comments
Open

Improve the CBT_Theme_Fonts class tests #711

matiasbenedetto opened this issue Aug 29, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@matiasbenedetto
Copy link
Contributor

matiasbenedetto commented Aug 29, 2024

What?

Simplify the CBT_Theme_Fonts class tests.

  • Try to make the tests more granular and simple.
  • Make the tests follow core guidelines.
  • Avoid manual operations to manipulate or create themes inside the test cases. Example:
    wp_set_current_user( self::$admin_id );
    $user_data_begin = CBT_Theme_JSON_Resolver::get_user_data()->get_settings();
    $test_theme_slug = $this->create_blank_theme();
    $this->activate_user_font();
    $user_data_before = CBT_Theme_JSON_Resolver::get_user_data()->get_settings();
    $theme_data_before = CBT_Theme_JSON_Resolver::get_theme_data()->get_settings();
    $this->save_theme();
    $user_data_after = CBT_Theme_JSON_Resolver::get_user_data()->get_settings();
    $theme_data_after = CBT_Theme_JSON_Resolver::get_theme_data()->get_settings();

Why?

  • Make the tests more effective for testing the class methods.
  • Make the tests easier to understand, maintain, and update.
@matiasbenedetto matiasbenedetto added the enhancement New feature or request label Aug 29, 2024
@matiasbenedetto matiasbenedetto changed the title Simplify the CBT_Theme_Fonts class tests Improve the CBT_Theme_Fonts class tests Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant