2022-02-08 22:27:12 +01:00
|
|
|
import { RequestCluster } from '../request-cluster';
|
|
|
|
import { ParsedAnswers } from './parse-answers';
|
2022-02-10 18:13:59 +01:00
|
|
|
import NoInformationAtAllProblem from './problems/no-information-at-all';
|
|
|
|
import { Problem } from './problems/problem';
|
|
|
|
import { UnlawfulCookieAccess } from './problems/unlawful-cookies';
|
2022-02-08 22:27:12 +01:00
|
|
|
|
|
|
|
export default function deduceProblems(
|
2022-02-10 17:07:47 +01:00
|
|
|
answers: ParsedAnswers,
|
|
|
|
clusters: Record<string, RequestCluster>
|
2022-02-08 22:27:12 +01:00
|
|
|
): Problem[] {
|
2022-02-10 17:07:47 +01:00
|
|
|
const problems = [];
|
|
|
|
if (answers.popup_type === 'none') {
|
|
|
|
problems.push(new NoInformationAtAllProblem(answers, clusters));
|
|
|
|
}
|
|
|
|
if (UnlawfulCookieAccess.qualifies(answers, Object.values(clusters))) {
|
|
|
|
problems.push(new UnlawfulCookieAccess(answers, clusters));
|
|
|
|
}
|
|
|
|
return problems;
|
2022-02-08 22:27:12 +01:00
|
|
|
}
|