mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
Add test case
This commit is contained in:
parent
bff9fcdc83
commit
e7e0807bfd
@ -89,6 +89,16 @@ describe('NPS survey', () => {
|
|||||||
expect(screen.getByText(/extremely likely/i)).toBeInTheDocument();
|
expect(screen.getByText(/extremely likely/i)).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("renders survey if settings don't exist", () => {
|
||||||
|
localStorageMock.getItem.mockReturnValueOnce(null);
|
||||||
|
setup();
|
||||||
|
act(() => jest.runAllTimers());
|
||||||
|
expect(screen.getByLabelText('0')).toBeInTheDocument();
|
||||||
|
expect(screen.getByLabelText('10')).toBeInTheDocument();
|
||||||
|
expect(screen.getByText(/not at all likely/i)).toBeInTheDocument();
|
||||||
|
expect(screen.getByText(/extremely likely/i)).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
it('does not render survey if disabled', () => {
|
it('does not render survey if disabled', () => {
|
||||||
localStorageMock.getItem.mockReturnValueOnce({ enabled: false });
|
localStorageMock.getItem.mockReturnValueOnce({ enabled: false });
|
||||||
setup();
|
setup();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user