-
Notifications
You must be signed in to change notification settings - Fork 1.6k
MM-68274 - Adding watermark capability in mobile #9682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
asaadmahmood
wants to merge
9
commits into
main
Choose a base branch
from
echo40-watermarking
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9ddc3cd
MM-68274 - Adding watermark capability in mobile
asaadmahmood 808ab9d
Resolving mobile comments
asaadmahmood 10ac162
Fix watermark overlay on Android
larkox f187bd4
Updating mobile
asaadmahmood 3320ef3
Merge branch 'echo40-watermarking' of github.com:mattermost/mattermos…
asaadmahmood 0a46133
Updating test and watermark
asaadmahmood 1c14435
Update watermark
asaadmahmood 02ff0f9
Update app/screens/home/channel_list/channel_list.test.tsx
asaadmahmood 51aa45e
Update tests
asaadmahmood File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,55 @@ | ||
| // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. | ||
| // See LICENSE.txt for license information. | ||
|
|
||
| import React from 'react'; | ||
|
|
||
| import {renderWithEverything, act} from '@test/intl-test-helper'; | ||
| import TestHelper from '@test/test_helper'; | ||
|
|
||
| import WatermarkScreenExport from './index'; | ||
|
|
||
| import type {Database} from '@nozbe/watermelondb'; | ||
|
|
||
| // The exported component is the HOC-wrapped version; we need to render it | ||
| // with full database context so withDatabase and withObservables can resolve. | ||
| describe('WatermarkScreen', () => { | ||
| let database: Database; | ||
| const serverUrl = 'http://www.someserver.com'; | ||
|
|
||
| beforeAll(async () => { | ||
| const server = await TestHelper.setupServerDatabase(serverUrl); | ||
| database = server.database; | ||
| }); | ||
|
|
||
| it('should render watermark text containing username and domain', async () => { | ||
| const {getAllByText} = renderWithEverything( | ||
| <WatermarkScreenExport componentId='Watermark'/>, | ||
| {database, serverUrl}, | ||
| ); | ||
|
|
||
| // The watermark renders its text multiple times (grid pattern). | ||
| // Verify at least one instance of the domain is present. | ||
| await act(async () => { | ||
| // Allow observables to emit | ||
| }); | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
larkox marked this conversation as resolved.
|
||
|
|
||
| // Domain extracted from serverUrl should be in the watermark text | ||
| const items = getAllByText(/www\.someserver\.com/); | ||
|
larkox marked this conversation as resolved.
Outdated
|
||
| expect(items.length).toBeGreaterThan(0); | ||
| }); | ||
|
|
||
| it('should render multiple copies of the watermark text for the grid pattern', async () => { | ||
| const {getAllByText} = renderWithEverything( | ||
| <WatermarkScreenExport componentId='Watermark'/>, | ||
| {database, serverUrl}, | ||
| ); | ||
|
|
||
| await act(async () => { | ||
| // Allow observables to emit | ||
| }); | ||
|
|
||
| // The watermark renders a grid of repeated text — expect more than one copy | ||
| const items = getAllByText(/www\.someserver\.com/); | ||
| expect(items.length).toBeGreaterThan(1); | ||
| }); | ||
| }); | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.