Skip to content

Commit

Permalink
Merge branch 'stage' of https://github.com/adobecom/milo into sartxi/…
Browse files Browse the repository at this point in the history
…MWPW-154980-publishing
  • Loading branch information
Sartxi committed Sep 16, 2024
2 parents 5932770 + 840e037 commit 5c5011f
Show file tree
Hide file tree
Showing 358 changed files with 23,425 additions and 6,919 deletions.
11 changes: 11 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ module.exports = {
files: ['test/**/*.js'],
rules: { 'no-console': 0 },
},
{
// Override for nala test
files: ['nala/**/*.js', 'nala/**/*.test.js'],
rules: {
'no-console': 0,
'import/no-extraneous-dependencies': 0,
'max-len': 0,
'chai-friendly/no-unused-expressions': 0,
'no-plusplus': 0,
},
},
],
ignorePatterns: [
'/libs/deps/*',
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const RCPDates = [
end: new Date('2024-09-12T14:00:00-07:00'),
},
{
start: new Date('2024-10-14T00:00:00-07:00'),
end: new Date('2024-11-18T17:00:00-08:00'),
start: new Date('2024-10-07T00:00:00-07:00'),
end: new Date('2024-10-18T17:00:00-07:00'),
},
{
start: new Date('2024-11-17T00:00:00-08:00'),
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/run-mas-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: MAS Unit Tests
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
run-tests:
name: Running tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install npm dependencies
run: npm install
working-directory: libs/features/mas

- name: Run npm test
run: npm test
working-directory: libs/features/mas

- name: Upload commerce coverage to Codecov
uses: codecov/codecov-action@v4
with:
name: mas-commerce
token: ${{ secrets.CODECOV_TOKEN }}
files: libs/features/mas/commerce/coverage/lcov.info

- name: Upload web-components coverage to Codecov
uses: codecov/codecov-action@v4
with:
name: mas-web-components
token: ${{ secrets.CODECOV_TOKEN }}
files: libs/features/mas/web-components/coverage/lcov.info
48 changes: 48 additions & 0 deletions .github/workflows/run-nala-default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Run Nala Tests

on:
push:
branches:
- stage
- main
pull_request:
branches:
- stage
- main
types: [opened, synchronize, reopened]

jobs:
run-nala-tests:
name: Running Nala E2E UI Tests
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Set execute permission for nalarun.sh
run: chmod +x ./nala/utils/pr.run.sh

- name: Run Nala Tests via pr.run.sh
run: ./nala/utils/pr.run.sh
env:
labels: ${{ join(github.event.pull_request.labels.*.name, ' ') }}
branch: ${{ github.event.pull_request.head.ref }}
repoName: ${{ github.repository }}
prUrl: ${{ github.event.pull_request.head.repo.html_url }}
prOrg: ${{ github.event.pull_request.head.repo.owner.login }}
prRepo: ${{ github.event.pull_request.head.repo.name }}
prBranch: ${{ github.event.pull_request.head.ref }}
prBaseBranch: ${{ github.event.pull_request.base.ref }}
GITHUB_ACTION_PATH: ${{ github.workspace }}
IMS_EMAIL: ${{ secrets.IMS_EMAIL }}
IMS_PASS: ${{ secrets.IMS_PASS }}
1 change: 0 additions & 1 deletion .github/workflows/run-nala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
jobs:
action:
name: Running E2E & IT
if: contains(github.event.pull_request.labels.*.name, 'run-nala')
runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ logs/*
.iml
.env
**/mas/*/stats.json
test-html-results/
test-results/
1 change: 1 addition & 0 deletions .hlxignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.*
*.md
test/*
nala
build/*
LICENSE
web-test-runner.config.mjs
Expand Down
2 changes: 1 addition & 1 deletion libs/blocks/article-feed/article-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export async function loadTaxonomy() {
a.href = tax.link;
} else {
// eslint-disable-next-line no-console
window.lana.log(`Trying to get a link for an unknown topic: ${topic} (current page)`, { tags: 'errorType=warn,module=article-feed' });
window.lana.log(`Trying to get a link for an unknown topic: ${topic} (current page)`, { tags: 'article-feed' });
a.href = '#';
}
delete a.dataset.topicLink;
Expand Down
9 changes: 5 additions & 4 deletions libs/blocks/article-header/article-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ function openPopup(e) {
}

async function buildAuthorInfo(authorEl, bylineContainer) {
const { href, textContent } = authorEl;
const { textContent } = authorEl;
const link = authorEl.href || authorEl.dataset.authorPage;
const config = getConfig();
const base = config.miloLibs || config.codeRoot;
const authorImg = createTag('div', { class: 'article-author-image' });
authorImg.style.backgroundImage = `url(${base}/blocks/article-header/adobe-logo.svg)`;
bylineContainer.prepend(authorImg);

const doc = await validateAuthorUrl(href);
const doc = await validateAuthorUrl(link);
if (!doc) {
const p = createTag('p', null, textContent);
authorEl.replaceWith(p);
Expand All @@ -48,7 +49,7 @@ async function buildAuthorInfo(authorEl, bylineContainer) {

const img = doc.querySelector('img');
if (img) {
img.setAttribute('alt', authorEl.textContent);
img.setAttribute('alt', textContent);
authorImg.append(img);
if (!img.complete) {
img.addEventListener('load', () => {
Expand Down Expand Up @@ -197,7 +198,7 @@ export default async function init(blockEl) {
bylineContainer.firstElementChild.classList.add('article-byline-info');

const authorContainer = bylineContainer.firstElementChild.firstElementChild;
const authorEl = authorContainer.querySelector('a');
const authorEl = authorContainer.firstElementChild;
authorContainer.classList.add('article-author');

buildAuthorInfo(authorEl, bylineContainer);
Expand Down
Loading

0 comments on commit 5c5011f

Please sign in to comment.