fix(rd21): retain draft revisions and qualify conflict recovery
This commit is contained in:
@@ -51,7 +51,7 @@ for (const [mode, language] of [['light', 'en'], ['dark', 'nb'], ['light', 'nb']
|
||||
education: [{ id: 'education-1', qualification: 'Computer science', institution: 'Fixture University', startDate: '2013-08', endDate: '2016-06' }],
|
||||
projects: [{ id: 'project-1', name: 'Evidence workspace', bullets: ['Documented source-grounded reviews.'] }], skills: ['C#', 'React', 'Norsk'],
|
||||
};
|
||||
expect((await page.request.put(`${apiUrl}/career/profile`, { headers, data: { profile } })).status()).toBe(200);
|
||||
expect((await page.request.put(`${apiUrl}/career/profile`, { headers, data: { expectedVersion: (await (await page.request.get(`${apiUrl}/career/profile`)).json()).revision, profile } })).status()).toBe(200);
|
||||
const source = await (await page.request.get(`${apiUrl}/career/profile`)).json();
|
||||
const outline: CvOutline = await (await page.request.get(`${apiUrl}/cv/outline`)).json();
|
||||
const entries = outline.sections.find(section => section.key === 'experience')!.entries;
|
||||
@@ -141,7 +141,7 @@ for (const [mode, language] of [['light', 'en'], ['dark', 'nb'], ['light', 'nb']
|
||||
await expect.poll(async () => (await read()).settings.overrides[first.key!].title).toBe('Retained CV title');
|
||||
await saved();
|
||||
const changedProfile = { ...profile, jobs: profile.jobs.map(job => job.id === 'job-1' ? { ...job, title: 'Updated source title', company: 'Updated source employer', bullets: ['Updated source evidence — æøå.'] } : job) };
|
||||
expect((await page.request.put(`${apiUrl}/career/profile`, { headers, data: { profile: changedProfile } })).status()).toBe(200);
|
||||
expect((await page.request.put(`${apiUrl}/career/profile`, { headers, data: { expectedVersion: (await (await page.request.get(`${apiUrl}/career/profile`)).json()).revision, profile: changedProfile } })).status()).toBe(200);
|
||||
const changedSource = await (await page.request.get(`${apiUrl}/career/profile`)).json();
|
||||
const beforeReload = await read();
|
||||
await page.reload();
|
||||
|
||||
Reference in New Issue
Block a user