mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-20 06:56:18 -05:00
build: uninstall Semantic UI
`semantic-ui-react`, `react-semantic-toasts-2` and `semantic-ui-offline` are
gone from package.json, the lockfile and node_modules -- 19 MB of dependencies
that nothing had imported since the migration finished.
Four things still referenced them and would have broken on uninstall. None was
caught by a build or by jest:
Four test files still ran `jest.mock('react-semantic-toasts-2', ...)` for
components that no longer use it. A jest.mock of a module that does not exist
throws, so the packages could not have come out without this.
`src/components/Download.cy.js` and `cypress/support/component.js` both
imported semantic.min.css. The support file now loads what the app loads --
index.css, the font and token stylesheets, and Mantine's.
The ratchet changes job rather than being deleted. An import of a missing module
fails loudly now, but three quieter mistakes would not: a `className="ui button"`
that styles nothing, a file reaching back through Theme.tsx, and someone
reinstalling a package to "just use one Semantic component". It asserts all
three, plus that package.json names nothing matching /semantic/i.
Two pre-existing problems in the cypress component harness surfaced while
checking the uninstall had not broken it, both fixed because that file had to be
edited anyway:
It imported `react-router-dom`, which is not installed -- this app is on
react-router v7. Dates to 5621d473, so the component suite has been
un-runnable since well before this migration.
Its mount helper supplied no MantineProvider, so every library component threw
-- the same gap test-utils.js had for jest.
The component specs now load and four pass; eleven assertions are still written
against markup from before they stopped running. Repairing those is its own
piece of work, deliberately not bundled in here. The e2e suite is unaffected:
43/43.
This commit is contained in:
parent
3c82291db3
commit
8ba73e64cd
9 changed files with 48 additions and 322 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import React from 'react';
|
||||
import {ArchiveDownloadForm, ChannelDownloadForm, EditRSSDownloadForm} from './Download';
|
||||
import 'semantic-ui-offline/semantic.min.css';
|
||||
|
||||
describe('<ArchiveDownloadForm />', () => {
|
||||
beforeEach(() => {
|
||||
|
|
|
|||
|
|
@ -11,10 +11,6 @@ jest.mock('../../api', () => ({
|
|||
getBatchReorganizationStatus: jest.fn(),
|
||||
}));
|
||||
|
||||
// Mock react-semantic-toasts-2
|
||||
jest.mock('react-semantic-toasts-2', () => ({
|
||||
toast: jest.fn(),
|
||||
}));
|
||||
|
||||
// Mock the FileWorkerStatusContext
|
||||
jest.mock('../../contexts/FileWorkerStatusContext', () => ({
|
||||
|
|
|
|||
|
|
@ -11,10 +11,6 @@ jest.mock('../../api', () => ({
|
|||
getReorganizationStatus: jest.fn(),
|
||||
}));
|
||||
|
||||
// Mock react-semantic-toasts-2
|
||||
jest.mock('react-semantic-toasts-2', () => ({
|
||||
toast: jest.fn(),
|
||||
}));
|
||||
|
||||
// Mock the FileWorkerStatusContext - default mock returns inactive state
|
||||
jest.mock('../../contexts/FileWorkerStatusContext', () => ({
|
||||
|
|
|
|||
|
|
@ -9,10 +9,6 @@ jest.mock('../../api', () => ({
|
|||
deleteFileGroups: jest.fn(),
|
||||
}));
|
||||
|
||||
// Mock react-semantic-toasts-2
|
||||
jest.mock('react-semantic-toasts-2', () => ({
|
||||
toast: jest.fn(),
|
||||
}));
|
||||
|
||||
describe('ConflictResolutionModal', () => {
|
||||
const mockConflicts = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue