-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(files_sharing): federated shares avatar
Signed-off-by: skjnldsv <[email protected]>
- Loading branch information
1 parent
e46f180
commit f78d63b
Showing
2 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/*! | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
import { describe, expect, it, afterEach } from 'vitest' | ||
import { generateAvatarSvg } from './AccountIcon' | ||
describe('AccountIcon', () => { | ||
|
||
afterEach(() => { | ||
delete document.body.dataset.themes | ||
}) | ||
|
||
it('should generate regular account avatar svg', () => { | ||
const svg = generateAvatarSvg('admin') | ||
expect(svg).toContain('/avatar/admin/32') | ||
expect(svg).not.toContain('dark') | ||
expect(svg).toContain('?guestFallback=true') | ||
}) | ||
|
||
it('should generate guest account avatar svg', () => { | ||
const svg = generateAvatarSvg('admin', true) | ||
expect(svg).toContain('/avatar/guest/admin/32') | ||
expect(svg).not.toContain('dark') | ||
expect(svg).not.toContain('?guestFallback=true') | ||
}) | ||
|
||
it('should generate dark mode account avatar svg', () => { | ||
document.body.dataset.themes = 'dark' | ||
const svg = generateAvatarSvg('admin') | ||
expect(svg).toContain('/avatar/admin/32/dark') | ||
expect(svg).toContain('?guestFallback=true') | ||
}) | ||
|
||
it('should generate dark mode guest account avatar svg', () => { | ||
document.body.dataset.themes = 'dark' | ||
const svg = generateAvatarSvg('admin', true) | ||
expect(svg).toContain('/avatar/guest/admin/32/dark') | ||
expect(svg).not.toContain('?guestFallback=true') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters