-
Notifications
You must be signed in to change notification settings - Fork 222
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
WSTEAM1-816: Set ckns_mvt cookie on all first time visits #12030
Open
HarveyPeachey
wants to merge
22
commits into
latest
Choose a base branch
from
WSTEAM1-816-set-ckns-mvt-all-first-visits
base: latest
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.
+180
−69
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
00f9388
adjusts withOptimizelyProvider usage
HarveyPeachey 219fd9d
adds extra test case
HarveyPeachey 6206a1e
adds check to have been called once
HarveyPeachey 598104c
moves cookie ckns_mvt setter logic to user context
HarveyPeachey 8d7697e
fixes order of userId check
HarveyPeachey d559889
adjust applyBasicPageHandlers api
HarveyPeachey 25c8e56
Merge branch 'latest' of https://github.com/bbc/simorgh into WSTEAM1-…
HarveyPeachey f3aafd4
updates readme
HarveyPeachey 119e7ad
removes test comments
HarveyPeachey 4e2f19c
readme updates
HarveyPeachey e7d13b5
removes console log
HarveyPeachey 03e761e
rearranges pipe
HarveyPeachey 6cc12a1
updates readme
HarveyPeachey 1e34a11
updates links
HarveyPeachey 84ab860
updates failing test
HarveyPeachey 0999ce6
Update README.md
HarveyPeachey e528410
Update README.md
HarveyPeachey 98aaa6a
Update src/app/contexts/UserContext/index.test.tsx
HarveyPeachey 624087d
updates test to be more explicit with ckns_mvt
HarveyPeachey 7a392d5
updates readme for added clarity
HarveyPeachey 041beb7
more readme updates
HarveyPeachey 9fc0d50
removes optimizely from article pages as no testing is happening
HarveyPeachey 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 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 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 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 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
24 changes: 0 additions & 24 deletions
24
src/app/legacy/containers/PageHandlers/withOptimizelyProvider/getOptimizelyUserId/index.js
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
...p/legacy/containers/PageHandlers/withOptimizelyProvider/getOptimizelyUserId/index.test.js
This file was deleted.
Oops, something went wrong.
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
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
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
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,38 @@ | ||
import * as pipe from 'ramda/src/pipe'; | ||
import WithContexts from '#app/legacy/containers/PageHandlers/withContexts'; | ||
import applyBasicPageHandlers from './applyBasicPageHandlers'; | ||
|
||
jest.mock('ramda/src/pipe', () => { | ||
const originalModule = jest.requireActual('ramda/src/pipe'); | ||
|
||
return { | ||
__esModule: true, | ||
...originalModule, | ||
default: originalModule, | ||
}; | ||
}); | ||
|
||
describe('applyBasicPageHandlers', () => { | ||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
jest.resetModules(); | ||
}); | ||
|
||
it('should call pipe with function as the argument before the withContexts argument when passed via handlerBeforeContexts', () => { | ||
const component = jest.fn(); | ||
const mockBeforeContextsFunction = jest.fn(); | ||
const pipeMock = jest.spyOn(pipe, 'default'); | ||
|
||
applyBasicPageHandlers(component, { | ||
handlerBeforeContexts: mockBeforeContextsFunction, | ||
}); | ||
|
||
const args = pipeMock.mock.calls[0]; | ||
const beforeContextsFunctionArg = args[3]; | ||
const WithContextsFunctionArg = args[4]; | ||
|
||
expect(beforeContextsFunctionArg).toEqual(mockBeforeContextsFunction); | ||
expect(WithContextsFunctionArg).toEqual(WithContexts); | ||
expect(mockBeforeContextsFunction).toHaveBeenCalledTimes(1); | ||
}); | ||
}); |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this mean that we dont set the cookie for opera mini (based of this and the unit tests)? can you remind me why if so! assuming that we just dont run experiments on opera mini for a weird opera reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually debated wether to set this on opera mini or not. The reason is because Opera mini extreme mode renders its' pages for the user on their servers, so that means all users using Opera Mini Extreme mode would have the same userId, making testing redundant. Although technically we can set it here as this effectively disables running optimizely for opera mini users anyway, I'll ask product and @andrewscfc to see what they think