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

chore: Add tests to publisher utils #5001

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

steverydz
Copy link
Contributor

@steverydz steverydz commented Jan 28, 2025

Done

Added tests for publisher utils

How to QA

All tests should pass (the inclusive naming check will fail)

Testing

  • This PR has tests
  • No testing required (explain why):

Issue / Card

Fixes https://warthogs.atlassian.net/browse/WD-18400

@webteam-app
Copy link

import getSettingsFormData from "../getSettingsFormData";

const settingsData = {
blacklist_countries: [],

Choose a reason for hiding this comment

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

[Inclusive naming check] reported by reviewdog 🐶
[warning] blacklist may be insensitive, use denylist, blocklist instead


const settingsData = {
blacklist_countries: [],
blacklist_country_keys: "",

Choose a reason for hiding this comment

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

[Inclusive naming check] reported by reviewdog 🐶
[warning] blacklist may be insensitive, use denylist, blocklist instead

update_metadata_on_release: false,
visibility: "private",
visibility_locked: false,
whitelist_countries: ["GB"],

Choose a reason for hiding this comment

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

[Inclusive naming check] reported by reviewdog 🐶
[warning] whitelist may be insensitive, use allowlist instead

visibility: "private",
visibility_locked: false,
whitelist_countries: ["GB"],
whitelist_country_keys: "",

Choose a reason for hiding this comment

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

[Inclusive naming check] reported by reviewdog 🐶
[warning] whitelist may be insensitive, use allowlist instead

};

const data = {
blacklist_countries: [],

Choose a reason for hiding this comment

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

[Inclusive naming check] reported by reviewdog 🐶
[warning] blacklist may be insensitive, use denylist, blocklist instead

update_metadata_on_release: false,
visibility: "private",
visibility_locked: false,
whitelist_countries: ["GB"],

Choose a reason for hiding this comment

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

[Inclusive naming check] reported by reviewdog 🐶
[warning] whitelist may be insensitive, use allowlist instead

visibility: "private",
visibility_locked: false,
whitelist_countries: ["GB"],
whitelist_country_keys: "",

Choose a reason for hiding this comment

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

[Inclusive naming check] reported by reviewdog 🐶
[warning] whitelist may be insensitive, use allowlist instead

territory_distribution_status: true,
unlisted: true,
visibility: true,
whitelist_country_keys: true,

Choose a reason for hiding this comment

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

[Inclusive naming check] reported by reviewdog 🐶
[warning] whitelist may be insensitive, use allowlist instead

expect(formData.get("snap_id")).toEqual("snap-id");
expect(formData.get("private")).toEqual("private");
expect(formData.get("territories")).toEqual("custom");
expect(formData.get("territories_custom_type")).toEqual("whitelist");

Choose a reason for hiding this comment

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

[Inclusive naming check] reported by reviewdog 🐶
[warning] whitelist may be insensitive, use allowlist instead

expect(formData.get("private")).toEqual("private");
expect(formData.get("territories")).toEqual("custom");
expect(formData.get("territories_custom_type")).toEqual("whitelist");
expect(formData.get("blacklist_countries")).toEqual("");

Choose a reason for hiding this comment

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

[Inclusive naming check] reported by reviewdog 🐶
[warning] blacklist may be insensitive, use denylist, blocklist instead

Copy link

@Ninfa-Jeon Ninfa-Jeon left a comment

Choose a reason for hiding this comment

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

LGTM

@steverydz steverydz merged commit 5a517d7 into main Jan 29, 2025
10 of 11 checks passed
@steverydz steverydz deleted the WD-18400-write-tests-for-publisher-utils branch January 29, 2025 08:25
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