Skip to content

Commit

Permalink
RISDEV-6075 Add norms category (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreas-deazevedo authored Jan 27, 2025
1 parent 71dd7f6 commit e50cf9f
Show file tree
Hide file tree
Showing 17 changed files with 1,922 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,7 @@ allowed_patterns:
- "existing keywords correctly"
- "renderComponent\\(keywords"
- "const keywords ="
- "function generateUniqueSingleNormKey"
- "const uniqueKey"
# patterns that trigger talisman otherwise
- "{ label: 'passive item', route: { name: 'not-matching' }"
63 changes: 63 additions & 0 deletions frontend/e2e/RubrikenPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,66 @@ test(
await expect(page.getByText('Kurzreferat Eintrag 123')).toHaveCount(1)
},
)

test(
'Add a norm, edit and save',
{tag: ['@RISDEV-6075']},
async ({page}) => {
// given
await page.goto('/')
await page.getByRole('button', { name: 'Neue Dokumentationseinheit' }).click()
await page.getByText('Rubriken').click()
await expect(page.getByText('Rubriken')).toHaveCount(1)
const normElement = page.getByRole('textbox', { name: 'RIS-Abkürzung' })
await expect(normElement).toHaveCount(1)

// when
await normElement.locator('xpath=..').getByRole('button', {name: 'Dropdown öffnen'}).click()
const kvlgButton = page.getByText('KVLG')
await expect(kvlgButton).toBeVisible()
await kvlgButton.click()
await page.getByRole('textbox', { name: 'Einzelnorm der Norm' }).fill('§ 2')
await page.getByRole('button', { name: 'Norm speichern' }).click()
await page.getByTestId('list-entry-0').click()
await page.getByRole('textbox', { name: 'Fassungsdatum' }).fill('27.01.2025')
await page.getByRole('button', { name: 'Norm speichern' }).click()

// then
await expect(page.getByText('KVLG, § 2, 27.01.2025')).toHaveCount(1)
},
)

test(
'Add two norms, delete the first item',
{ tag: ['@RISDEV-6075'] },
async ({ page }) => {
// given
await page.goto('/')
await page.getByRole('button', { name: 'Neue Dokumentationseinheit' }).click()
await page.getByText('Rubriken').click()
await expect(page.getByText('Rubriken')).toHaveCount(1)
const normElement = page.getByRole('textbox', { name: 'RIS-Abkürzung' })
await expect(normElement).toHaveCount(1)

// when
await normElement.locator('xpath=..').getByRole('button', {name: 'Dropdown öffnen'}).click()
const sgb5Button = page.getByText('SGB 5')
await expect(sgb5Button).toBeVisible()
await sgb5Button.click()
await page.getByRole('textbox', { name: 'Einzelnorm der Norm' }).fill('1991, Seite 92')
await page.getByRole('button', { name: 'Norm speichern' }).click()
await normElement.locator('xpath=..').getByRole('button', {name: 'Dropdown öffnen'}).click()
const kvlgButton = page.getByText('KVLG')
await expect(kvlgButton).toBeVisible()
await kvlgButton.click()
await page.getByRole('textbox', { name: 'Einzelnorm der Norm' }).fill('§ 2')
await page.getByRole('button', { name: 'Norm speichern' }).click()
await page.getByTestId('list-entry-0').click()
await page.getByText('Eintrag löschen').click()


// then
await expect(page.getByText('SGB 5, 1991, Seite 92')).toHaveCount(0)
await expect(page.getByText('KVLG, § 2')).toHaveCount(1)
},
)
2 changes: 1 addition & 1 deletion frontend/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default [

{
name: 'app/files-to-ignore',
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**', '**/html/**'],
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**', '**/html/**', '**/frontend-e2e-test-report-html/**'],
},

...pluginVue.configs['flat/essential'],
Expand Down
Loading

0 comments on commit e50cf9f

Please sign in to comment.