Skip to content

Commit b620588

Browse files
committed
style: Fix broken lint
1 parent 3827f7d commit b620588

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

src/library-authoring/import-course/stepper/ReviewImportDetails.test.tsx

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ describe('ReviewImportDetails', () => {
5959

6060
it('renders import progress status when isBlockDataPending or migrationInfoIsPending is true', async () => {
6161
(useCourseDetails as jest.Mock).mockReturnValue({ isPending: false, data: { title: 'Test Course' } });
62-
(useLibraryBlockLimits as jest.Mock).mockReturnValue({ isPending: false, data: { maxBlocksPerContentLibrary: 100 } });
62+
(useLibraryBlockLimits as jest.Mock).mockReturnValue({
63+
isPending: false,
64+
data: { maxBlocksPerContentLibrary: 100 },
65+
});
6366
(useMigrationInfo as jest.Mock).mockReturnValue({
6467
isPending: true,
6568
data: null,
@@ -74,7 +77,10 @@ describe('ReviewImportDetails', () => {
7477

7578
it('renders warning when reimport', async () => {
7679
(useCourseDetails as jest.Mock).mockReturnValue({ isPending: false, data: { title: 'Test Course' } });
77-
(useLibraryBlockLimits as jest.Mock).mockReturnValue({ isPending: false, data: { maxBlocksPerContentLibrary: 100 } });
80+
(useLibraryBlockLimits as jest.Mock).mockReturnValue({
81+
isPending: false,
82+
data: { maxBlocksPerContentLibrary: 100 },
83+
});
7884
(useMigrationInfo as jest.Mock).mockReturnValue({
7985
isPending: false,
8086
data: {
@@ -103,7 +109,10 @@ describe('ReviewImportDetails', () => {
103109

104110
it('renders warning when unsupportedBlockPercentage > 0', async () => {
105111
(useCourseDetails as jest.Mock).mockReturnValue({ isPending: false, data: { title: 'Test Course' } });
106-
(useLibraryBlockLimits as jest.Mock).mockReturnValue({ isPending: false, data: { maxBlocksPerContentLibrary: 100 } });
112+
(useLibraryBlockLimits as jest.Mock).mockReturnValue({
113+
isPending: false,
114+
data: { maxBlocksPerContentLibrary: 100 },
115+
});
107116
(useMigrationInfo as jest.Mock).mockReturnValue({
108117
isPending: false,
109118
data: null,
@@ -141,7 +150,10 @@ describe('ReviewImportDetails', () => {
141150

142151
it('renders warning when components exceed the limit', async () => {
143152
(useCourseDetails as jest.Mock).mockReturnValue({ isPending: false, data: { title: 'Test Course' } });
144-
(useLibraryBlockLimits as jest.Mock).mockReturnValue({ isPending: false, data: { maxBlocksPerContentLibrary: 20 } });
153+
(useLibraryBlockLimits as jest.Mock).mockReturnValue({
154+
isPending: false,
155+
data: { maxBlocksPerContentLibrary: 20 },
156+
});
145157
(useMigrationInfo as jest.Mock).mockReturnValue({
146158
isPending: false,
147159
data: null,
@@ -179,7 +191,10 @@ describe('ReviewImportDetails', () => {
179191

180192
it('considers children blocks of unsupportedBlocks', async () => {
181193
(useCourseDetails as jest.Mock).mockReturnValue({ isPending: false, data: { title: 'Test Course' } });
182-
(useLibraryBlockLimits as jest.Mock).mockReturnValue({ isPending: false, data: { maxBlocksPerContentLibrary: 100 } });
194+
(useLibraryBlockLimits as jest.Mock).mockReturnValue({
195+
isPending: false,
196+
data: { maxBlocksPerContentLibrary: 100 },
197+
});
183198
(useMigrationInfo as jest.Mock).mockReturnValue({
184199
isPending: false,
185200
data: null,
@@ -230,7 +245,10 @@ describe('ReviewImportDetails', () => {
230245

231246
it('renders success alert when no unsupported blocks', async () => {
232247
(useCourseDetails as jest.Mock).mockReturnValue({ isPending: false, data: { title: 'Test Course' } });
233-
(useLibraryBlockLimits as jest.Mock).mockReturnValue({ isPending: false, data: { maxBlocksPerContentLibrary: 100 } });
248+
(useLibraryBlockLimits as jest.Mock).mockReturnValue({
249+
isPending: false,
250+
data: { maxBlocksPerContentLibrary: 100 },
251+
});
234252
(useMigrationInfo as jest.Mock).mockReturnValue({
235253
isPending: false,
236254
data: null,

src/library-authoring/import-course/stepper/ReviewImportDetails.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,16 @@ export const ReviewImportDetails = ({ courseId, markAnalysisComplete }: Props) =
201201
0,
202202
) - finalUnsupportedBlocks;
203203

204-
let resultUnsupportedByLimit = 0
204+
let resultUnsupportedByLimit = 0;
205205
if (libraryBlockLimits && resultTotalComponents > libraryBlockLimits.maxBlocksPerContentLibrary) {
206-
resultUnsupportedByLimit = resultTotalComponents - libraryBlockLimits.maxBlocksPerContentLibrary
207-
resultTotalComponents -= resultUnsupportedByLimit
206+
resultUnsupportedByLimit = resultTotalComponents - libraryBlockLimits.maxBlocksPerContentLibrary;
207+
resultTotalComponents -= resultUnsupportedByLimit;
208208
}
209-
209+
210210
return {
211211
totalComponents: resultTotalComponents,
212212
unsupportedByLimit: resultUnsupportedByLimit,
213-
}
213+
};
214214
}, [blockTypes, finalUnsupportedBlocks, libraryBlockLimits]);
215215

216216
// Adds the components exceed the limit to the final unsupported count
@@ -224,7 +224,7 @@ export const ReviewImportDetails = ({ courseId, markAnalysisComplete }: Props) =
224224
return undefined;
225225
}
226226
return Object.values(blockTypes).reduce((total, block) => total + block, 0) - finalUnsupportedBlocks;
227-
}, [blockTypes, finalUnsupportedBlocks]);
227+
}, [blockTypes, finalUnsupportedBlocks]);
228228

229229
/** Calculate the unsupported block percentage based on the final total blocks and unsupported blocks. */
230230
const unsupportedBlockPercentage = useMemo(() => {

0 commit comments

Comments
 (0)