feat(champ siret): improve default base SIRET column wording
This commit is contained in:
parent
b71d60dff9
commit
985cf32752
2 changed files with 16 additions and 1 deletions
|
@ -116,7 +116,12 @@ class TypesDeChamp::TypeDeChampBase
|
|||
private
|
||||
|
||||
def libelle_with_prefix(prefix)
|
||||
[prefix, libelle].compact.join(' – ')
|
||||
# SIRET needs to be explicit in listings for better UI readability
|
||||
if type_champ == "siret" && !libelle.upcase.include?("SIRET")
|
||||
[prefix, libelle, "SIRET"].compact.join(' – ')
|
||||
else
|
||||
[prefix, libelle].compact.join(' – ')
|
||||
end
|
||||
end
|
||||
|
||||
def paths
|
||||
|
|
|
@ -7,6 +7,16 @@ describe TypesDeChamp::SiretTypeDeChamp do
|
|||
describe "#columns" do
|
||||
subject(:columns) { tdc_siret.columns(procedure: procedure) }
|
||||
|
||||
it "returns base column without duplicating SIRET when already in libelle" do
|
||||
expect(columns[0].label).to eq("Numéro SIRET")
|
||||
end
|
||||
|
||||
it "returns base column with SIRET when libelle doesn't contain SIRET" do
|
||||
tdc_siret.update(libelle: "Identification de l'entreprise")
|
||||
|
||||
expect(columns[0].label).to eq("Identification de l'entreprise – SIRET")
|
||||
end
|
||||
|
||||
it "includes required jsonpaths" do
|
||||
expected_paths = [
|
||||
"$.entreprise_raison_sociale",
|
||||
|
|
Loading…
Reference in a new issue