Skip to content

Commit d918243

Browse files
sluFicodesSHENGXING LU
andauthored
some tag colission fixed (#176)
* some tag colission fixed * local cypress test error because proxy now returns the role attribute fixed --------- Co-authored-by: SHENGXING LU <slu@SHENGXINGs-MacBook-Air.local>
1 parent 170c761 commit d918243

4 files changed

Lines changed: 42 additions & 36 deletions

File tree

cypress/support/constants.ts

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@ export const init_config = {
2323
'domePublish': 'https://knowledgebase.dome-marketplace.org/shelves/company-onboarding-process',
2424
'purchaseEnabled': false,
2525
'defaultId': 'urn:ngsi-ld:catalog:32828e1d-4652-4f4c-b13e-327450ce83c6',
26-
"theme": "DOME"
27-
26+
'theme': 'DOME',
27+
'roles': {
28+
'seller': 'Seller',
29+
'customer': 'Buyer',
30+
'admin': 'admin',
31+
'orgAdmin': 'orgAdmin',
32+
'certifier': 'certifier'
33+
}
2834
}
2935

3036
export const init_stat = {"_id":"677ff8d160055e7a1e2544ff","services":["Service test 1"],"organizations":["org test 1"],"__v":0}
@@ -270,41 +276,41 @@ export const checkHeaderPostLogin = () => {
270276

271277
export const loginAcc = () => {
272278
checkHeaderPreLogin()
273-
local_items.expire = moment().unix() + 100
274-
cy.window().then((window) => window.localStorage.setItem('login_items', JSON.stringify(local_items)))
279+
local_items.expire = moment().unix() + 100
280+
cy.window().then((window) => window.localStorage.setItem('login_items', JSON.stringify(local_items)))
275281

276-
// Mocks
277-
cy.intercept(
278-
{
279-
method: 'GET',
280-
url: 'http://proxy.docker:8004/logintoken'
281-
},
282-
(req) => {
283-
req.reply({
284-
statusCode: 200,
285-
body: login_token()
286-
});
287-
}
288-
).as('login_token');
282+
// Mocks
283+
cy.intercept(
284+
{
285+
method: 'GET',
286+
url: 'http://proxy.docker:8004/logintoken'
287+
},
288+
(req) => {
289+
req.reply({
290+
statusCode: 200,
291+
body: login_token()
292+
});
293+
}
294+
).as('login_token');
289295

290-
cy.visit('/dashboard?token=test', {onBeforeLoad(win) {
291-
win.document.documentElement.classList.add('dark');
292-
}})
296+
cy.visit('/dashboard?token=test', {onBeforeLoad(win) {
297+
win.document.documentElement.classList.add('dark');
298+
}})
293299

294-
cy.wait('@stats')
295-
cy.get('@stats.all').should('have.length', 2)
296-
cy.wait('@config')
297-
cy.get('@config.all').should('have.length', 2)
298-
//cy.wait('@productOffering')
299-
//cy.get('@productOffering.all').should('have.length', 2)
300-
cy.wait('@catalog')
301-
cy.get('@catalog.all').should('have.length', 2)
302-
cy.wait('@category')
303-
cy.get('@category.all').should('have.length', 2)
304-
cy.wait('@login_token')
305-
cy.get('@login_token.all').should('have.length', 1)
300+
cy.wait('@stats')
301+
cy.get('@stats.all').should('have.length', 2)
302+
cy.wait('@config')
303+
cy.get('@config.all').should('have.length', 2)
304+
//cy.wait('@productOffering')
305+
//cy.get('@productOffering.all').should('have.length', 2)
306+
cy.wait('@catalog')
307+
cy.get('@catalog.all').should('have.length', 2)
308+
cy.wait('@category')
309+
cy.get('@category.all').should('have.length', 2)
310+
cy.wait('@login_token')
311+
cy.get('@login_token.all').should('have.length', 1)
306312

307-
checkHeaderPostLogin()
313+
checkHeaderPostLogin()
308314
}
309315

310316
export const productOffering = {

src/app/offerings/featured/featured.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div class="flex flex-col w-full h-full bg-secondary-50 dark:bg-secondary-100 rounded-lg dark:border-secondary-100 border-secondary-50 border">
77

88
<div class="flex-1 h-full bg-cover bg-right-bottom bg-opacity-25 rounded-lg" style="background-image: url(assets/logos/dome-logo-element-colour.png)">
9-
<div class="flex-1 h-full px-5 py-5 bg-secondary-50/95 dark:bg-secondary-100/95 rounded-lg">
9+
<div data-cy="categoryItem" class="flex-1 h-full px-5 py-5 bg-secondary-50/95 dark:bg-secondary-100/95 rounded-lg">
1010
<a class="cursor-pointer">
1111
<h5 class="text-xl font-semibold line-clamp-2 tracking-tight text-primary-100 dark:text-white text-wrap break-words">{{cat.name}}</h5>
1212
</a>

src/app/pages/dashboard/dashboard.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div data-cy="mainText">
1313
<h1 class="mb-4 text-left text-4xl font-extrabold tracking-tight md:text-5xl lg:text-6xl text-secondary-50">{{ 'DASHBOARD._header' | translate }}</h1>
1414
<p class="text-left mb-8 text-lg font-normal lg:text-xl text-secondary-50">{{ 'DASHBOARD._subheader' | translate }}</p>
15-
<button data-cy="browseServices" id="browseServices" (click)="goTo('/search')"
15+
<button data-cy="browseServicesDashboard" id="browseServices" (click)="goTo('/search')"
1616
class="inline-flex justify-left items-center border border-1 border-white py-3 px-5 text-base font-medium text-center text-white rounded-lg hover:bg-primary-50 ">
1717
<svg class=" mr-2 w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
1818
{{ 'DASHBOARD._browse_serv' | translate }}

src/app/shared/categories-filter/categories-filter.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ <h2 [id]="'accordion-heading-'+idx">
2323
</div>
2424
</div>
2525
} @else {
26-
<bae-category-item [data]="category" [isParent]="true" [isFirst]="$first" [isLast]="$last"></bae-category-item>
26+
<bae-category-item data-cy="categoryItemService" [data]="category" [isParent]="true" [isFirst]="$first" [isLast]="$last"></bae-category-item>
2727
}
2828
}
2929
</h2>

0 commit comments

Comments
 (0)