feat(cv): rebuild professional resume studio
This commit is contained in:
@@ -32,7 +32,7 @@ const mockedApi = api as jest.Mocked<typeof api>;
|
||||
|
||||
function renderPage() {
|
||||
return render(
|
||||
<MemoryRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
|
||||
<MemoryRouter>
|
||||
<ToastProvider>
|
||||
<I18nProvider>
|
||||
<ConfirmProvider>
|
||||
@@ -53,7 +53,7 @@ beforeEach(() => {
|
||||
test('lists existing CVs from the variants API', async () => {
|
||||
mockedApi.get.mockResolvedValueOnce({
|
||||
data: [
|
||||
{ id: 1, name: 'Frontend CV', themeId: 'modern', publicSlug: 'abc', isPublic: true, version: 2, jobApplicationId: null, updatedAtUtc: new Date().toISOString() },
|
||||
{ id: 1, name: 'Frontend CV', themeId: 'modern', language: 'en', publicSlug: 'abc', isPublic: true, version: 2, jobApplicationId: 17, jobTitle: 'Frontend Engineer', companyName: 'Northstar', updatedAtUtc: new Date().toISOString() },
|
||||
],
|
||||
} as any);
|
||||
|
||||
@@ -61,6 +61,7 @@ test('lists existing CVs from the variants API', async () => {
|
||||
|
||||
expect(await screen.findByText('Frontend CV')).toBeInTheDocument();
|
||||
expect(screen.getByText('Public')).toBeInTheDocument();
|
||||
expect(screen.getByText(/Frontend Engineer at Northstar/)).toBeInTheDocument();
|
||||
const cvCard = screen.getByRole('link', { name: 'Open Frontend CV' });
|
||||
cvCard.focus();
|
||||
expect(cvCard).toHaveFocus();
|
||||
@@ -79,6 +80,9 @@ test('shows the empty state and creates a CV then navigates to the editor', asyn
|
||||
|
||||
fireEvent.click(screen.getAllByRole('button', { name: /New CV/i })[0]);
|
||||
|
||||
expect(await screen.findByRole('dialog', { name: 'Create a CV' })).toBeInTheDocument();
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Create CV' }));
|
||||
|
||||
await waitFor(() => expect(mockedApi.post).toHaveBeenCalledWith('/cv/variants', expect.objectContaining({ name: 'Untitled CV' })));
|
||||
await waitFor(() => expect(mockNavigate).toHaveBeenCalledWith('/career/builder/42'));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user