Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e2b538d4
Commit
e2b538d4
authored
Jun 09, 2021
by
Vitaly Slobodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust specs after rebase
parent
ac047c40
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
4 deletions
+38
-4
ee/app/assets/javascripts/admin/components/qrtly_reconciliation_alert.vue
...vascripts/admin/components/qrtly_reconciliation_alert.vue
+8
-1
ee/app/assets/javascripts/admin/init_qrtly_reconciliation_alert.js
...sets/javascripts/admin/init_qrtly_reconciliation_alert.js
+1
-1
ee/spec/frontend/admin/components/qrtly_reconciliation_alert_spec.js
...ntend/admin/components/qrtly_reconciliation_alert_spec.js
+29
-2
No files found.
ee/app/assets/javascripts/admin/components/qrtly_reconciliation_alert.vue
View file @
e2b538d4
<
script
>
<
script
>
import
{
GlAlert
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
Cookie
from
'
js-cookie
'
;
import
Cookie
from
'
js-cookie
'
;
import
{
helpPagePath
}
from
'
~/helpers/help_page_helper
'
;
import
{
formatDate
,
getDayDifference
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
formatDate
,
getDayDifference
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
s__
,
__
,
sprintf
}
from
'
~/locale
'
;
import
{
s__
,
__
,
sprintf
}
from
'
~/locale
'
;
...
@@ -18,6 +19,10 @@ it will be charged. Otherwise, you will receive an invoice.`),
...
@@ -18,6 +19,10 @@ it will be charged. Otherwise, you will receive an invoice.`),
const
CONTACT_SUPPORT_URL
=
'
https://about.gitlab.com/support/#contact-support
'
;
const
CONTACT_SUPPORT_URL
=
'
https://about.gitlab.com/support/#contact-support
'
;
const
qrtlyReconciliationHelpPageUrl
=
helpPagePath
(
'
subscriptions/self_managed/index
'
,
{
anchor
:
'
quarterly-subscription-reconciliation
'
,
});
export
default
{
export
default
{
name
:
'
QrtlyReconciliationAlert
'
,
name
:
'
QrtlyReconciliationAlert
'
,
components
:
{
components
:
{
...
@@ -26,7 +31,7 @@ export default {
...
@@ -26,7 +31,7 @@ export default {
},
},
props
:
{
props
:
{
date
:
{
date
:
{
type
:
Number
,
type
:
Date
,
required
:
true
,
required
:
true
,
},
},
cookieKey
:
{
cookieKey
:
{
...
@@ -51,6 +56,7 @@ export default {
...
@@ -51,6 +56,7 @@ export default {
},
},
i18n
,
i18n
,
CONTACT_SUPPORT_URL
,
CONTACT_SUPPORT_URL
,
qrtlyReconciliationHelpPageUrl
,
};
};
</
script
>
</
script
>
...
@@ -60,6 +66,7 @@ export default {
...
@@ -60,6 +66,7 @@ export default {
variant=
"info"
variant=
"info"
:title=
"alertTitle"
:title=
"alertTitle"
:primary-button-text=
"$options.i18n.learnMore"
:primary-button-text=
"$options.i18n.learnMore"
:primary-button-link=
"$options.qrtlyReconciliationHelpPageUrl"
:secondary-button-text=
"$options.i18n.contactSupport"
:secondary-button-text=
"$options.i18n.contactSupport"
:secondary-button-link=
"$options.CONTACT_SUPPORT_URL"
:secondary-button-link=
"$options.CONTACT_SUPPORT_URL"
@
dismiss=
"handleDismiss"
@
dismiss=
"handleDismiss"
...
...
ee/app/assets/javascripts/admin/init_qrtly_reconciliation_alert.js
View file @
e2b538d4
...
@@ -13,7 +13,7 @@ export const initQrtlyReconciliationAlert = (selector = '#js-qrtly-reconciliatio
...
@@ -13,7 +13,7 @@ export const initQrtlyReconciliationAlert = (selector = '#js-qrtly-reconciliatio
render
(
createElement
)
{
render
(
createElement
)
{
return
createElement
(
QrtlyReconciliationAlert
,
{
return
createElement
(
QrtlyReconciliationAlert
,
{
props
:
{
props
:
{
date
:
Date
.
pars
e
(
el
.
dataset
.
reconciliationDate
),
date
:
new
Dat
e
(
el
.
dataset
.
reconciliationDate
),
cookieKey
:
el
.
dataset
.
cookieKey
,
cookieKey
:
el
.
dataset
.
cookieKey
,
},
},
});
});
...
...
ee/spec/frontend/admin/components/qrtly_reconciliation_alert_spec.js
View file @
e2b538d4
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Cookie
from
'
js-cookie
'
;
import
QrtlyReconciliationAlert
from
'
ee/admin/components/qrtly_reconciliation_alert.vue
'
;
import
QrtlyReconciliationAlert
from
'
ee/admin/components/qrtly_reconciliation_alert.vue
'
;
jest
.
mock
(
'
js-cookie
'
,
()
=>
({
set
:
jest
.
fn
(),
}));
describe
(
'
Qrtly Reconciliation Alert
'
,
()
=>
{
describe
(
'
Qrtly Reconciliation Alert
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
const
reconciliationDate
=
new
Date
(
'
2020-0
1-01
'
);
const
reconciliationDate
=
new
Date
(
'
2020-0
7-10
'
);
const
createComponent
=
()
=>
{
const
createComponent
=
()
=>
{
return
shallowMount
(
QrtlyReconciliationAlert
,
{
return
shallowMount
(
QrtlyReconciliationAlert
,
{
propsData
:
{
propsData
:
{
cookieKey
:
'
key
'
,
date
:
reconciliationDate
,
date
:
reconciliationDate
,
},
},
});
});
...
@@ -24,7 +30,28 @@ describe('Qrtly Reconciliation Alert', () => {
...
@@ -24,7 +30,28 @@ describe('Qrtly Reconciliation Alert', () => {
describe
(
'
Rendering
'
,
()
=>
{
describe
(
'
Rendering
'
,
()
=>
{
it
(
'
renders alert title with date
'
,
()
=>
{
it
(
'
renders alert title with date
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlAlert
).
attributes
(
'
title
'
)).
toContain
(
`occur on
${
reconciliationDate
}
`
);
expect
(
wrapper
.
find
(
GlAlert
).
attributes
(
'
title
'
)).
toContain
(
`occur on 2020-07-10`
);
});
it
(
'
has the correct link to the help page
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlAlert
).
attributes
(
'
primarybuttonlink
'
)).
toBe
(
'
/help/subscriptions/self_managed/index#quarterly-subscription-reconciliation
'
,
);
});
it
(
'
has the correct link to contact support
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlAlert
).
attributes
(
'
secondarybuttonlink
'
)).
toBe
(
'
https://about.gitlab.com/support/#contact-support
'
,
);
});
});
describe
(
'
methods
'
,
()
=>
{
it
(
'
sets the cookie on dismis
'
,
()
=>
{
wrapper
.
find
(
GlAlert
).
vm
.
$emit
(
'
dismiss
'
);
expect
(
Cookie
.
set
).
toHaveBeenCalledTimes
(
1
);
expect
(
Cookie
.
set
).
toHaveBeenCalledWith
(
'
key
'
,
true
,
{
expires
:
4
});
});
});
});
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment