Skip to content

Commit

Permalink
fx
Browse files Browse the repository at this point in the history
  • Loading branch information
oskogstad committed Sep 18, 2024
1 parent 85226cc commit ab4096f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Digdir.Domain.Dialogporten.Application.Common.Extensions.FluentValidation;
using Digdir.Domain.Dialogporten.Application.Common.Pagination;
using Digdir.Domain.Dialogporten.Application.Features.V1.Common.Localizations;
using Digdir.Domain.Dialogporten.Domain.Common;
using Digdir.Domain.Dialogporten.Domain.Localizations;
using Digdir.Domain.Dialogporten.Domain.Parties;
using Digdir.Domain.Dialogporten.Domain.Parties.Abstractions;
Expand Down Expand Up @@ -53,8 +54,8 @@ public SearchDialogQueryValidator()
RuleForEach(x => x.Status).IsInEnum();

RuleFor(x => x.Process)
.Must(x => Uri.IsWellFormedUriString(x, UriKind.Absolute))
.WithMessage("{PropertyName} must be a valid URI")
.IsValidUri()
.MaximumLength(Constants.DefaultMaxUriLength)
.When(x => x.Process is not null);
}
}
1 change: 0 additions & 1 deletion tests/k6/suites/all-single-pass.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { runAllTests } from "../tests/all-tests.js";
import { default as summary } from "../common/summary.js";
import { chai, describe } from '../common/testimports.js'


export let options = {};

export default function () {
Expand Down
2 changes: 1 addition & 1 deletion tests/k6/tests/enduser/dialogSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export default function () {
});

describe('List with invalid process filter', () => {
let r = getEU('dialogs/' + defaultFilter + '&process=?? ?');
let r = getEU('dialogs/' + defaultFilter + '&process=inval|d');
expectStatusFor(r).to.equal(400);
expect(r, 'response').to.have.validJsonBody();
expect(r.json(), 'response json').to.have.property("errors");
Expand Down
2 changes: 1 addition & 1 deletion tests/k6/tests/serviceowner/dialogCreateInvalidProcess.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function (){

describe ('Attempt to create dialog with invalid URI', () => {
let dialog = dialogToInsert();
dialog.process = '?? ?';
dialog.process = 'inval|d';
let r = postSO('dialogs', dialog)
expectStatusFor(r).to.equal(400);
expect(r, 'response').to.have.validJsonBody();
Expand Down
2 changes: 1 addition & 1 deletion tests/k6/tests/serviceowner/dialogSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export default function () {
});

describe('List with invalid process', () => {
let r = getSO('dialogs/?CreatedAfter=' + createdAfter + '&process=?? ?');
let r = getSO('dialogs/?CreatedAfter=' + createdAfter + '&process=inval|d');
expectStatusFor(r).to.equal(400);
expect(r, 'response').to.have.validJsonBody();
expect(r.json(), 'response json').to.have.property("errors");
Expand Down

0 comments on commit ab4096f

Please sign in to comment.