-
Notifications
You must be signed in to change notification settings - Fork 58
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
[FEATURE] S'assurer que les images de Modules de prod respectent les contraintes tech (PIX-17215) #11842
Merged
pix-service-auto-merge
merged 4 commits into
dev
from
tech-test-image-production-readiness
Mar 26, 2025
Merged
[FEATURE] S'assurer que les images de Modules de prod respectent les contraintes tech (PIX-17215) #11842
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
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
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 |
---|---|---|
|
@@ -8,16 +8,17 @@ describe('Unit | Devcomp | Domain | Models | Element | Image', function () { | |
// when | ||
const image = new Image({ | ||
id: 'id', | ||
url: 'url', | ||
url: 'https://assets.pix.org/modules/placeholder-details.svg', | ||
alt: 'alt', | ||
alternativeText: 'alternativeText', | ||
legend: 'legend', | ||
licence: 'licence', | ||
isBeta: false, | ||
}); | ||
|
||
// then | ||
expect(image.id).to.equal('id'); | ||
expect(image.url).to.equal('url'); | ||
expect(image.url).to.equal('https://assets.pix.org/modules/placeholder-details.svg'); | ||
expect(image.alt).to.equal('alt'); | ||
expect(image.alternativeText).to.equal('alternativeText'); | ||
expect(image.legend).to.equal('legend'); | ||
|
@@ -48,11 +49,22 @@ describe('Unit | Devcomp | Domain | Models | Element | Image', function () { | |
}); | ||
}); | ||
|
||
describe('An image without alt', function () { | ||
describe('An image with invalid url', function () { | ||
it('should throw an error', function () { | ||
// when | ||
const error = catchErrSync(() => new Image({ id: 'id', url: 'url' }))(); | ||
|
||
// then | ||
expect(error).to.be.instanceOf(DomainError); | ||
expect(error.message).to.equal('The URL must be a valid URL for an image'); | ||
}); | ||
}); | ||
|
||
describe('An image without alt', function () { | ||
it('should throw an error', function () { | ||
// when | ||
const error = catchErrSync(() => new Image({ id: 'id', url: 'https://images.pix.fr/coolcat.jpg' }))(); | ||
|
||
// then | ||
expect(error).to.be.instanceOf(DomainError); | ||
expect(error.message).to.equal('The alt text is required for an image'); | ||
|
@@ -62,11 +74,35 @@ describe('Unit | Devcomp | Domain | Models | Element | Image', function () { | |
describe('An image without an alternative text', function () { | ||
it('should throw an error', function () { | ||
// when | ||
const error = catchErrSync(() => new Image({ id: 'id', url: 'url', alt: 'alt' }))(); | ||
const error = catchErrSync(() => new Image({ id: 'id', url: 'https://images.pix.fr/coolcat.jpg', alt: 'alt' }))(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Coolman qui choisit l'image Coolcat .. La Brigade du cool a encore frappé |
||
|
||
// then | ||
expect(error).to.be.instanceOf(DomainError); | ||
expect(error.message).to.equal('The alternative text is required for an image'); | ||
}); | ||
}); | ||
|
||
describe('When isBeta is false', function () { | ||
describe('and image URL is not from assets.pix.org', function () { | ||
it('should throw an error', function () { | ||
// given & when | ||
const error = catchErrSync( | ||
() => | ||
new Image({ | ||
id: 'id', | ||
url: 'https://images.pix.fr/coolcat.jpg', | ||
alt: 'alt', | ||
alternativeText: 'alternativeText', | ||
legend: 'legend', | ||
licence: 'licence', | ||
isBeta: false, | ||
}), | ||
)(); | ||
|
||
// then | ||
expect(error).to.be.instanceOf(DomainError); | ||
expect(error.message).to.equal('The image URL must be from "assets.pix.org" when module is production ready'); | ||
}); | ||
}); | ||
}); | ||
}); |
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
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.
Suggestion : variabiliser le hostname pour éviter que ce soit trop en clair dans le repo ?
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.
Discuté ensemble, ça reste hautement expérimental et temporaire, on ne s'embête pas à le variabiliser pour le moment