Compare commits

...

3 Commits

Author SHA1 Message Date
Elias Schneider
d92b80b80f release: 0.2.1 2024-08-19 23:16:02 +02:00
Elias Schneider
aaed71e1c8 tests: fix update general configuration test 2024-08-19 23:15:19 +02:00
Elias Schneider
4780548843 fix: session duration can't be updated 2024-08-19 23:10:14 +02:00
5 changed files with 18 additions and 5 deletions

View File

@@ -1 +1 @@
0.2.0
0.2.1

View File

@@ -1,3 +1,10 @@
## [](https://github.com/stonith404/pocket-id/compare/v0.2.0...v) (2024-08-19)
### Bug Fixes
* session duration can't be updated ([4780548](https://github.com/stonith404/pocket-id/commit/478054884389ed8a08d707fd82da7b31177a67e5))
## [](https://github.com/stonith404/pocket-id/compare/v0.1.3...v) (2024-08-19)

View File

@@ -16,5 +16,6 @@ type AppConfig struct {
}
type AppConfigUpdateDto struct {
AppName string `json:"appName" binding:"required"`
AppName string `json:"appName" binding:"required"`
SessionDuration string `json:"sessionDuration" binding:"required"`
}

View File

@@ -55,7 +55,7 @@ var defaultDbConfig = model.AppConfig{
}
func (s *AppConfigService) UpdateApplicationConfiguration(input model.AppConfigUpdateDto) ([]model.AppConfigVariable, error) {
savedConfigVariables := make([]model.AppConfigVariable, 10)
var savedConfigVariables []model.AppConfigVariable
tx := s.db.Begin()
rt := reflect.ValueOf(input).Type()
@@ -78,7 +78,7 @@ func (s *AppConfigService) UpdateApplicationConfiguration(input model.AppConfigU
return nil, err
}
savedConfigVariables[i] = applicationConfigurationVariable
savedConfigVariables = append(savedConfigVariables, applicationConfigurationVariable)
}
tx.Commit()

View File

@@ -10,10 +10,15 @@ test('Update general configuration', async ({ page }) => {
await page.getByLabel('Session Duration').fill('30');
await page.getByRole('button', { name: 'Save' }).first().click();
await expect(page.getByTestId('application-name')).toHaveText('Updated Name');
await expect(page.getByRole('status')).toHaveText(
'Application configuration updated successfully'
);
await expect(page.getByTestId('application-name')).toHaveText('Updated Name');
await page.reload();
await expect(page.getByLabel('Name')).toHaveValue('Updated Name');
await expect(page.getByLabel('Session Duration')).toHaveValue('30');
});
test('Update application images', async ({ page }) => {