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

WIP: misc/license unit tests #1559

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

WIP: misc/license unit tests #1559

wants to merge 2 commits into from

Conversation

jvorcak
Copy link
Collaborator

@jvorcak jvorcak commented Dec 11, 2024

No description provided.

@jvorcak jvorcak marked this pull request as draft December 11, 2024 08:57
@jvorcak jvorcak changed the title Misc/license unit tests WIP: misc/license unit tests Dec 11, 2024
});

// Check that user is informed about a license that will expire.
expect(screen.getByText(/Your Redpanda Enterprise license will expire in 27 days/)).toBeInTheDocument();
Copy link
Contributor

@malinskibeniamin malinskibeniamin Dec 11, 2024

Choose a reason for hiding this comment

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

I think this may be sensitive to some timezone changes, we always default to GMT timezone, maybe you can say

const DAYS = 28
... expire in ${DAYS - 1}

return Math.floor(Date.now() / 1000) + daysOffset * 86400;
};

vi.mock('../../state/backendApi', () => {
Copy link
Contributor

@malinskibeniamin malinskibeniamin Dec 11, 2024

Choose a reason for hiding this comment

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

I think you may need to keep the rest of the API intact, you can do so by

async (importOriginal) => {
    const actual = await importOriginal();
    return { ...actual, api: { ...actual.api, someChangeGoesHere };
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants