test: update tests

I don't use events anymore but update a Svelte store.
Not sure how to test it.

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
This commit is contained in:
André Jaenisch 2024-08-12 13:07:45 +02:00
parent c86902b2f8
commit 564d9bb6a7
No known key found for this signature in database
GPG key ID: 5A668E771F1ED854

View file

@ -48,24 +48,6 @@ describe('SettingsAppearance.svelte', () => {
expect(screen.getByLabelText(enMessages.settings.appearance.theme.auto)).toBeInTheDocument(); expect(screen.getByLabelText(enMessages.settings.appearance.theme.auto)).toBeInTheDocument();
}); });
describe('when clicking a theme', () => {
it('should dispatch a switch-theme event', () => {
// Arrange
const listener = vi.fn();
// Act
const { component } = render(SettingsAppearance);
component.$on('switch-theme', listener);
const darkTheme = screen.getByLabelText(enMessages.settings.appearance.theme.dark);
darkTheme.click();
const ev = new CustomEvent({ detail: 'dark' });
// Assert
expect(listener).toHaveBeenCalledOnce();
expect(listener).toHaveBeenCalledWith(ev);
});
});
// TODO: Mark up proper label and input // TODO: Mark up proper label and input
it.skip('should have a tab indent input', () => { it.skip('should have a tab indent input', () => {
// Arrange // Arrange