Skip to content

Commit

Permalink
MOBILE-4470 behat: Fix grades behat tests
Browse files Browse the repository at this point in the history
In LMS there was a nasty hack to return different content based on whether the site was running behat or not. This hack has been removed in MDL-77685, so now we can remove the isAutomated check from the grades code
  • Loading branch information
dpalou committed Jun 7, 2024
1 parent 66df465 commit 4dd7b45
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/core/features/grades/services/grades-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import { CoreError } from '@classes/errors/error';
import { CoreCourseHelper } from '@features/course/services/course-helper';
import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate';
import { CoreCourseAccess } from '@features/course/services/course-options-delegate';
import { CorePlatform } from '@services/platform';

export const GRADES_PAGE_NAME = 'grades';
export const GRADES_PARTICIPANTS_PAGE_NAME = 'participant-grades';
Expand Down Expand Up @@ -105,8 +104,8 @@ export class CoreGradesHelperProvider {
row.rowclass += itemNameColumn.class.indexOf('hidden') >= 0 ? ' hidden' : '';
row.rowclass += itemNameColumn.class.indexOf('dimmed_text') >= 0 ? ' dimmed_text' : '';

if (!useLegacyLayout && !CorePlatform.isAutomated()) {
// Activity name is only included in the webservice response from the latest version when behat is not running.
if (!useLegacyLayout) {
// Remove the "title" of the row (activity name, 'Manual item', 'Aggregation', etc.).
content = content.replace(/<span[^>]+>.+?<\/span>/i, '');
}

Expand Down

0 comments on commit 4dd7b45

Please sign in to comment.