Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4152509
pageviews.test.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
pageviews.test.js
View Options
import
pageviews
from
'../../../src/reducers/pageviews'
;
import
actionTypes
from
'../../../src/actionTypes'
;
/* eslint-disable camelcase */
const
PAGEVIEW
=
{
page_title
:
'Bears'
,
page_id
:
1
,
page_namespace
:
0
},
PAGE
=
{
url
:
'http://localhost:8888/w/index.php?title=Bird_like_dinosaur'
,
title
:
'Bird like dinosaur'
,
namespaceId
:
0
,
id
:
673
};
/* eslint-enable camelcase */
QUnit
.
module
(
'ext.popups/reducers#pageviews'
,
{
beforeEach
()
{
this
.
initialState
=
pageviews
(
undefined
,
{
type
:
'@@INIT'
}
);
}
}
);
QUnit
.
test
(
'BOOT'
,
function
(
assert
)
{
const
action
=
{
type
:
actionTypes
.
BOOT
,
page
:
PAGE
};
assert
.
deepEqual
(
pageviews
(
this
.
initialState
,
action
),
{
page
:
PAGE
,
pageview
:
undefined
},
'It should set the current page.'
);
}
);
QUnit
.
test
(
'PREVIEW_SEEN'
,
(
assert
)
=>
{
const
action
=
{
type
:
actionTypes
.
PREVIEW_SEEN
,
title
:
'Bears'
,
pageId
:
1
,
namespace
:
0
};
assert
.
deepEqual
(
pageviews
(
{
page
:
PAGE
},
action
),
{
page
:
PAGE
,
pageview
:
PAGEVIEW
},
'It should set a flag requesting a pageview is recorded.'
);
}
);
QUnit
.
test
(
'PAGEVIEW_LOGGED'
,
(
assert
)
=>
{
const
action
=
{
type
:
actionTypes
.
PAGEVIEW_LOGGED
};
assert
.
deepEqual
(
pageviews
(
{
pageview
:
PAGEVIEW
,
page
:
PAGE
},
action
),
{
page
:
PAGE
,
pageview
:
undefined
},
'When complete it should remove the pageview record.'
);
}
);
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Aug 19 2026, 20:23 (7 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
29/dd/577f050110bdf09cb0f0f5ef544e
Default Alt Text
pageviews.test.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment