Skip to content

Commit fd15e9a

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent 08af377 commit fd15e9a

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

kolibri/plugins/device/frontend/views/DeviceSettingsPage/__tests__/DeviceSettingsPage.spec.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,25 @@ async function makeWrapper() {
7878
routes,
7979
stubs: ['AppBarPage'],
8080
});
81-
81+
8282
// Need to wait for beforeMount to finish
8383
await global.flushPromises();
8484
}
8585

86-
8786
function getButtons() {
8887
const saveButton = screen.getByRole('button', { name: /save changes/i });
8988
const learnPage = screen.getByRole('radio', { name: /Learn page/i });
9089
const signInPage = screen.getByRole('radio', { name: /Sign-in page/i });
91-
const allowGuestAccess = screen.getByRole('radio', { name: /Allow users to explore resources without signing in/i });
92-
const disallowGuestAccess = screen.getByRole('radio', { name: /Learners must sign in to explore resources/i });
93-
const lockedContent = screen.getByRole('radio', { name: /Signed in learners should only see resources assigned to them in classes/i });
94-
90+
const allowGuestAccess = screen.getByRole('radio', {
91+
name: /Allow users to explore resources without signing in/i,
92+
});
93+
const disallowGuestAccess = screen.getByRole('radio', {
94+
name: /Learners must sign in to explore resources/i,
95+
});
96+
const lockedContent = screen.getByRole('radio', {
97+
name: /Signed in learners should only see resources assigned to them in classes/i,
98+
});
99+
95100
return {
96101
learnPage,
97102
signInPage,
@@ -110,7 +115,7 @@ function assertIsDisabled(button, expected) {
110115
if (expected) {
111116
expect(button).toBeDisabled();
112117
} else {
113-
expect(button).not.toBeDisabled();
118+
expect(button).toBeEnabled();
114119
}
115120
}
116121

@@ -122,7 +127,6 @@ function assertIsSelected(button, expected) {
122127
}
123128
}
124129

125-
126130
describe('DeviceSettingsPage', () => {
127131
beforeEach(() => {
128132
jest.clearAllMocks();
@@ -276,7 +280,7 @@ describe('DeviceSettingsPage', () => {
276280
await clickRadioButton(lockedContent);
277281
await fireEvent.click(saveButton);
278282

279-
await global.flushPromises();
283+
await global.flushPromises();
280284
// Implications: Cannot see "explore without account" AND cannot see "channels" tab
281285
expect(api.saveDeviceSettings).toHaveBeenCalledWith(
282286
expect.objectContaining({
@@ -288,4 +292,3 @@ describe('DeviceSettingsPage', () => {
288292
});
289293
});
290294
});
291-
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import {render, fireEvent , screen} from '@testing-library/vue';
1+
import { render, fireEvent, screen } from '@testing-library/vue';
22
import '@testing-library/jest-dom';
33
import WelcomeModal from '../WelcomeModal';
44

55
describe('WelcomeModal', () => {
66
it('submits the welcome form successfully', async () => {
77
const submitListener = jest.fn();
8-
8+
99
render(WelcomeModal, {
1010
listeners: {
1111
submit: submitListener,
1212
},
1313
});
14-
14+
1515
const submitButton = screen.getByRole('button', { name: /continue/i });
1616
await fireEvent.click(submitButton);
1717
expect(submitListener).toHaveBeenCalledTimes(1);
1818
});
19-
});
19+
});

0 commit comments

Comments
 (0)