Skip to content

Commit

Permalink
Merge pull request #849 from intuitem/CA-380-calendar-bug-on-same-mon…
Browse files Browse the repository at this point in the history
…th-of-next-years-2

added functional front end tests - about section
  • Loading branch information
nas-tabchiche authored Sep 19, 2024
2 parents 7fed1a8 + 0902007 commit 4b7763b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
16 changes: 10 additions & 6 deletions frontend/src/lib/components/Modals/DisplayJSONModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@
{$modalStore[0].title ?? '(title missing)'}
</header>
{#if body}
{#each Object.entries(JSON.parse(body)) as [key, value]}
<div>
<div class="font-bold capitalize">{key}:</div>
<div>{value}</div>
</div>
{/each}
<div data-testid="key-value">
{#each Object.entries(JSON.parse(body)) as [key, value]}
<div>
<div class="font-bold capitalize">{key}:</div>
<div>{value}</div>
<div data-testid="{key}-key" class="font-bold capitalize">{key}:</div>
<div data-testid="{key}-value">{value}</div>
</div>
{/each}
</div>
{/if}
</div>
{/if}
8 changes: 8 additions & 0 deletions frontend/tests/functional/nav.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ test('sidebar navigation tests', async ({ logedPage, analyticsPage, sideBar, pag
await expect(logedPage.modalTitle).toBeVisible();
await expect.soft(logedPage.modalTitle).toHaveText('About CISO Assistant');
await logedPage.checkForUndefinedText();
await expect(logedPage.page.getByTestId('version-key')).toContainText('version', {
ignoreCase: true
});
await expect(logedPage.page.getByTestId('version-value')).toBeTruthy();
await expect(logedPage.page.getByTestId('build-key')).toContainText('build', {
ignoreCase: true
});
await expect(logedPage.page.getByTestId('build-value')).toBeTruthy();
await page.mouse.click(20, 20); // click outside the modal to close it
await expect(logedPage.modalTitle).not.toBeVisible();

Expand Down

0 comments on commit 4b7763b

Please sign in to comment.